From patchwork Mon May 8 09:33:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "zhaoyang.huang" X-Patchwork-Id: 9029 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2028847vqo; Mon, 8 May 2023 02:48:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4RB2afMDGCugrGm/vbyLTPCBAX+vOhF7RU/b/urSNm5ptZtt9V6YeyYe/2eNTlqqKe/w+v X-Received: by 2002:a17:90b:390e:b0:24d:fcd2:bdad with SMTP id ob14-20020a17090b390e00b0024dfcd2bdadmr9551082pjb.35.1683539285612; Mon, 08 May 2023 02:48:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683539285; cv=none; d=google.com; s=arc-20160816; b=Wv4iHUSexLgtBmre1GsXypMuZVKfM04DZk24Ek6JfeebQdUBsQFPpS9o9h6va9RuqP 9PMeLLN1IAcaQu/msWc2i6nqX0aN7OtWXyexEfjDOFzShdIoF91s7DvRERlePQ1lvyQb SHEL25GPpHw7h9csUY+ray/Z2MHoAwQtK3KI7vkZIS5VCL9InDHbiQtlKDyeJ3uB0D/0 1BCK6u2rJGbr0VKLC47iILUgRkSSzGYZ57Mcqv3PZ9ziKpiCMOjP7jc8PUlA7cl8NDUn Pcp+JaAV2TaWM9dFLiNJXtxuhCQKY/CymtP68wLQkuSGwjaUJRia35QfDAwPtix4VliD hp0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:to:from; bh=muQY/u4lUWmd2skLXsBbUbUAYAKTtF+g/j2MOETYYFM=; b=UYn2P6CTtAphkFFzauTsA69eUZgHQKzmbbs4ZzR7wGx6fFW6qabjNxGpTyfCvqPqOE 96rSF8J8QPVYasAsh8Wqm9Mag4UNUM5A9dmL3Rp554R2Q378nOV1MmwcbxdENkrKHmvm kfKaMlVSPe6u+1zFwB7LKFvUO/pUi127sF0NmI3Ew2F4wblU/NrMxRJvaaohj8S72/Vw Fc5r4Uw3ouuVw7lsi+jHbGwCFG9b2Ux7V00tDiOvC2XBxF/Rg4pjLs+iQqg/1ucLy1o6 q5Td7OMc/jQH67GeP2PtKMBbBEg3maC1a/j9bks555JusR9/YLPNHBCyaXSVsRX8exb0 VVxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i1-20020a17090a058100b0024c0c3c81e4si12064452pji.83.2023.05.08.02.47.49; Mon, 08 May 2023 02:48:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233738AbjEHJft (ORCPT + 99 others); Mon, 8 May 2023 05:35:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233615AbjEHJfq (ORCPT ); Mon, 8 May 2023 05:35:46 -0400 Received: from SHSQR01.spreadtrum.com (mx1.unisoc.com [222.66.158.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6398EFD for ; Mon, 8 May 2023 02:35:42 -0700 (PDT) Received: from SHSend.spreadtrum.com (bjmbx01.spreadtrum.com [10.0.64.7]) by SHSQR01.spreadtrum.com with ESMTP id 3489XOjT032670; Mon, 8 May 2023 17:33:24 +0800 (+08) (envelope-from zhaoyang.huang@unisoc.com) Received: from bj03382pcu.spreadtrum.com (10.0.74.65) by BJMBX01.spreadtrum.com (10.0.64.7) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Mon, 8 May 2023 17:33:19 +0800 From: "zhaoyang.huang" To: Andrew Morton , Roman Gushchin , Minchan Kim , Roman Gushchin , Joonsoo Kim , , , Zhaoyang Huang , Subject: [PATCH 0/2] Optimization of CMA allocation and reclaiming Date: Mon, 8 May 2023 17:33:01 +0800 Message-ID: <1683538383-19685-1-git-send-email-zhaoyang.huang@unisoc.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.0.74.65] X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To BJMBX01.spreadtrum.com (10.0.64.7) X-MAIL: SHSQR01.spreadtrum.com 3489XOjT032670 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765318890348908886?= X-GMAIL-MSGID: =?utf-8?q?1765318890348908886?= From: Zhaoyang Huang These two commits help to solve bellowing OOM issue which all free pages are composed of CMA. 04166 < 4> [ 36.172486] [03-19 10:05:52.172] ActivityManager: page allocation failure: order:0, mode:0xc00(GFP_NOIO), nodemask=(null),cpuset=foreground,mems_allowed=0 0419C < 4> [ 36.189447] [03-19 10:05:52.189] DMA32: 0*4kB 447*8kB (C) 217*16kB (C) 124*32kB (C) 136*64kB (C) 70*128kB (C) 22*256kB (C) 3*512kB (C) 0*1024kB 0*2048kB 0*4096kB = 35848kB 0419D < 4> [ 36.193125] [03-19 10:05:52.193] Normal: 231*4kB (UMEH) 49*8kB (MEH) 14*16kB (H) 13*32kB (H) 8*64kB (H) 2*128kB (H) 0*256kB 1*512kB (H) 0*1024kB 0*2048kB 0*4096kB = 3236kB ...... 041EA < 4> [ 36.234447] [03-19 10:05:52.234] SLUB: Unable to allocate memory on node -1, gfp=0xa20(GFP_ATOMIC) 041EB < 4> [ 36.234455] [03-19 10:05:52.234] cache: ext4_io_end, object size: 64, buffer size: 64, default order: 0, min order: 0 041EC < 4> [ 36.234459] [03-19 10:05:52.234] node 0: slabs: 53,objs: 3392, free: 0 Zhaoyang Huang (2): mm: optimization on page allocation when CMA enabled mm: skip CMA pages when they are not available mm/page_alloc.c | 46 ++++++++++++++++++++++++++++++++++++++++------ mm/vmscan.c | 15 +++++++++++++-- 2 files changed, 53 insertions(+), 8 deletions(-)