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: 13234266 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45C14C77B73 for ; Mon, 8 May 2023 09:34:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 89D5D6B0078; Mon, 8 May 2023 05:34:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 826C96B007D; Mon, 8 May 2023 05:34:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7188F6B007E; Mon, 8 May 2023 05:34:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 640216B0078 for ; Mon, 8 May 2023 05:34:12 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 3597FC02BC for ; Mon, 8 May 2023 09:34:12 +0000 (UTC) X-FDA: 80766576744.08.2E6EF51 Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) by imf17.hostedemail.com (Postfix) with ESMTP id 0B98140004 for ; Mon, 8 May 2023 09:34:08 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=none; spf=pass (imf17.hostedemail.com: domain of zhaoyang.huang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=zhaoyang.huang@unisoc.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1683538450; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references; bh=muQY/u4lUWmd2skLXsBbUbUAYAKTtF+g/j2MOETYYFM=; b=roqlOV/MKGfCt+NMzu6h12/VjLT2FJ6RQ4lQ+UdLC2WARlFj7B9B6OKZH4f/Krsgeqdi1j jzjnCrlECbGRTi0bzKJ4ZY8chnAh8e3o+gGlxKJ7qpQs8SqJx916dGDBxD2nIrN+xw3rM0 Abvqh8Nl5Z8AcVHFuXzCyK0xRWFaZFE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1683538450; a=rsa-sha256; cv=none; b=T6Mhw+dZ8WkRNp0wrYp+ivnm4WGaeEpRksaqp99wjrt1DTdVm2IVmckGv38SEaYdYwRzqs EfmRbKCYqXxAontO4XR/qvuEGaRe3UgQbpfsEqnQNO8UUsdgi0NdkaXl17Ku/mEipRIEjQ +gKU0PG7jNIBjjBxbMcohHIvFxu8GJM= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=none; spf=pass (imf17.hostedemail.com: domain of zhaoyang.huang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=zhaoyang.huang@unisoc.com; dmarc=none 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-Stat-Signature: uwoifb9t6xtf9ycajrtsg6ncp6c1f3u1 X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 0B98140004 X-HE-Tag: 1683538448-800211 X-HE-Meta: U2FsdGVkX1+ZrV8TcNgfaeKt3OaFCOoxSP3tp0PRFnqZ0qIbhdLaGG/kutDjZB/gjKYYaByBpO68rvFl2Zuvz8mN6lFIgulrM5FmxlVlWTbJsu685QZOoGpuVehLkTFIYD2tXSDsFbR25Se5OeZI7Nq8aq/vN7PcOhRvnbeHEDsVFFTriPHiu9PZFSFZ34Aj8iQnPDRp+6ZRHlzAbWxVUetvflIbT5HsenUK6UM4b/zCgZ3Ejz8/mxLE3I+1GUVYcbB6fgiRF7/h4CfCtNCWrgCliguXys/bptbj/hJQXAbQvTT4cKc94rfw4S5X+0RED7hrekbt4AUcC4J/MXwlAErOtz5H6Ge7243pBBOm7EnnW+ZlHem02ZefZykFrd5xp7bsBj17/BAK3u7SIMU+698jApKhjDf4IBveU+kK0JZZilNY5HqZfNDUBzE/wc7fI3cOcgFVJghjdj4tq4q1zqav7BPs7gjD5COqhB2JVfCg0kRWNRwsIKLux9fvGfuPtOQkSbsRj+ZYcsWw3ln3fh2dOMiYDClbhYpHH+E24iazlVsuynDvjLQTIFkS+m4aucJxc528C/nLnbKC77/+js5L4ObIBwPrePby4J8VfSF7KcrmZDtZcPzmAKMIO+AbpHu1iyVJ5mHEmwi02SZcSFe3fSfNDMAmHbj33DaX2EPGwRdo1h68Eoe8BTpNEmrcpIXMXBBi3dnAwwa7zMNQSfre1uzIIi/T1SQ/0JslUBLphAgddCVcOZg6rGUn0rXaNMNpfd1ZC1uP04Ua9tXCO2fkGA25sKu5SevQcdcmnhCylPEGTnA/b5epecF9kpcZDYDggBlD/V7e2DmsIZ2LIVaFcz9WrdWO/cwer7+ivjXLJG6HVG8VA0TZDMOPN24d2togJ0a7t1zFVn0T3JuiF9iUFFTSLKz/5K4Q88SPtqjy8+/lWgQAqKk60Red4nLHZ90zRFj7QoxhCVyM1NN Xk9iVoKL BOX1BCiRPfHchvsS/rlVaCMYLIViEGeYBZTB9cd4yssIbR8sSDR+Tn1dsu6rwzrZrW6EIQ7xF008OQGLldyyEbasX/jM9BJbURSsQJr2kqy9nh22xsG92zefD7TOmSsOMxdD8QRYxD3Hpk81smwKu3msTwRNBCxZ1uV0viFmstq6qQwFY5OQUiSGuNkkLkvp04oO7N42OhWyNoyYarc/x42mvHl3nmnmUyNijIAZlaXps7MuGHLC9/Qv2c2CoR4J4jEhVAv7rcRdlGeJxHoErW9iVsJ5A+CZtaHJ4vj58tv4B6fp1OYBJUvF4ew== X-Bogosity: Ham, tests=bogofilter, spamicity=0.009397, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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(-)