From patchwork Mon Sep 11 10:49:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "zhaoyang.huang" X-Patchwork-Id: 13379170 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 CEDCCEE57DF for ; Mon, 11 Sep 2023 10:50:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1790E6B0277; Mon, 11 Sep 2023 06:50:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1286C6B0278; Mon, 11 Sep 2023 06:50:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 016CC6B0279; Mon, 11 Sep 2023 06:50:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id E3D9B6B0277 for ; Mon, 11 Sep 2023 06:50:17 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id A3D8DC06B0 for ; Mon, 11 Sep 2023 10:50:17 +0000 (UTC) X-FDA: 81223997274.06.2F310B3 Received: from SHSQR01.spreadtrum.com (mx1.unisoc.com [222.66.158.135]) by imf07.hostedemail.com (Postfix) with ESMTP id 6554840025 for ; Mon, 11 Sep 2023 10:50:13 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf07.hostedemail.com: domain of zhaoyang.huang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=zhaoyang.huang@unisoc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1694429416; 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:content-transfer-encoding:in-reply-to: references; bh=aozesofd0H8RmKp7jTbMyRJGvFmXYyigRajHSsKCYp0=; b=ubkq7so8Lp6PTjrGEatwoytk4CA4j4q/wlH3kjP/HjNvV4pa5vKB1kJ28fr99QokgsUBFT qbihtYF1iGLpsa45v2U1M5jO8/VqcNPXs05fF5lb+o65axhKBW1qVNZ5G3zd2Y819K2YHY xVcHgnzLZ1Ss1yaYr/Rdxb2RISVPfDA= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf07.hostedemail.com: domain of zhaoyang.huang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=zhaoyang.huang@unisoc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1694429416; a=rsa-sha256; cv=none; b=R8aG4gC6Ux4EwB3UsKiRO84qGPSDpoDpdb0VB4Yk7oLy/pq+tAtJWKUVOtwFfghJMHoba1 XFjav5qvn2U1wqz6jbDoIwtsebQX8V7wbiIrS/9mCUdj8l7prtsNyYqTiGsBrQMgg4FBqT om97HNxllJbhEMsMi/jTCmo0ASxray4= Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 38BAnDF3026510; Mon, 11 Sep 2023 18:49:13 +0800 (+08) (envelope-from zhaoyang.huang@unisoc.com) Received: from SHDLP.spreadtrum.com (bjmbx01.spreadtrum.com [10.0.64.7]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4Rkk0N2ltsz2Rkw7N; Mon, 11 Sep 2023 18:46:12 +0800 (CST) Received: from bj03382pcu01.spreadtrum.com (10.0.73.40) by BJMBX01.spreadtrum.com (10.0.64.7) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Mon, 11 Sep 2023 18:49:10 +0800 From: "zhaoyang.huang" To: Andrew Morton , Matthew Wilcox , Michal Hocko , , , Zhaoyang Huang , Subject: [PATCH] mm: remove redundant clear page when CONFIG_INIT_ON_ALLOC_DEFAULT_ON configured Date: Mon, 11 Sep 2023 18:49:06 +0800 Message-ID: <20230911104906.2058503-1-zhaoyang.huang@unisoc.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.0.73.40] X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To BJMBX01.spreadtrum.com (10.0.64.7) X-MAIL: SHSQR01.spreadtrum.com 38BAnDF3026510 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 6554840025 X-Stat-Signature: 3q3tkee1tq5ntf5roy3c88ba4dhmm8ii X-Rspam-User: X-HE-Tag: 1694429413-349665 X-HE-Meta: U2FsdGVkX1+VnHrpOdsmJGC2dAxnrcYXEzjnetvsHach3cjJ4jsQXF/Ug27JSv01+cbncRF65Bj6V8XGvDDt4sqHVNEGe8dPzg8r0u2ipwcldWpH4DP8hOr6TsQ1kEBpBq24A/IcKeU0uxcyor4v9VS5hZAAiUHl8aZnY80vKhpJosh+63NgWi5Hw7yCH1YcpkZ5FXUsW1IQdhzHagR43sBO8ZHb2lpPhl6qB7Jgyu+YVGYUIB7mBsTvCaZom6yJJP+Cmh2fD4h9fnDnte443oBgLgiyhtTG3j38WPFw5/eiTos88he50/QOkd6LcZoqQjglL7kaebHDfZkPFcJUFSIkTRRlShSTlYaxGGWMgkSITyoNVhgLvvgQ3/uWYyodSYglf86+1xG5xOzdH4YInQFEa19N2DcUzxppwgX9c/SXqpLBK91LNiWtezoGA+iazy38dB84JqL/WQpVOHJWikAFoRvc2fZJCg1kEYS7+Dmb1s8vCl7Xdj7zvpCVJvV+T0UochLHCTVBMAGuWC3/J6v3Ok4HqgAX5pX3MVTc8RHUcT/ijqirZGDi6DFOoI9qPZCrO/uEQEnq5tvpfXBy+jx7EH8GwjN2RijTLPXi/88blIgyfHk/oeQ4oXf9Na/y4yi5bjGQkJHoyabK+cAXaSfTGcohrP89sMLPKElirA/OQ+QMQ7DEyUpqQY+I4C+10m2rqmApREX1FmHzagxf8XuE5B9UwO4fxcZpj+15M4TziF/NSZBNQYjzEYtZot7pgYFqlv10n5IJ8Olcfo8vkgQsrBvG7JOshTCnnXjt7jHaPQMk5CKfwiNxbAp8RkRCaaNi1wv3yvdh1hb3eoyCRMRWDmubDTOpweJr1veE8L7kD3lp4fd3zDJtiLmgb8tvnaJEc8XNDPe5WsQ7k3KIxLR8vmXEug/vpR2cY/ctI2VMjmTBtK3mwQ2SWeu+7dqD247cQrV36HQTyvsfZb7 qVv7fYa/ iaeAtJ4IOn7OpWMHKQ0tTyXZTsu3rmbP6KqCt3Y4nmv+zyMtCidznPKZAR/pQVHOx5It532zsO15gE9pOFf/ZxGGcN5szTXa0C41iN3Q6frYKkKG0bFsZkWOPAvpltZZ7SWPNT2ng/vuETde9ZRi6t/12R8oZYPc1z6N4XoqGqPiG1OrqOXMthT5yRZfaXpV9d4LkOT1GgZ0apFYdbqPyvn1cumRcJdkOkEi6qWt79eSYfa/ibzW8Q41mkpUD30Dbe+ZQhq/JGBSdN8R3Owl6seIYqMOKD7CvrxA27hYl4VFUwBxquzceCuM1CJCs7NQvEOfm4cPe5uE4P4kv6b4MbfpOgg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Zhaoyang Huang There will be redundant clear page within vma_alloc_zeroed_movable_folio when CONFIG_INIT_ON_ALLOC_DEFAULT_ON is on. Remove it by judging related configs. Signed-off-by: Zhaoyang Huang Acked-by: Michal Hocko --- include/linux/highmem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 99c474de800d..3926f8414729 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h @@ -227,7 +227,7 @@ struct folio *vma_alloc_zeroed_movable_folio(struct vm_area_struct *vma, struct folio *folio; folio = vma_alloc_folio(GFP_HIGHUSER_MOVABLE, 0, vma, vaddr, false); - if (folio) + if (folio && !want_init_on_alloc(GFP_HIGHUSER_MOVABLE)) clear_user_highpage(&folio->page, vaddr); return folio;