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: 137937 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp53854vqx; Mon, 11 Sep 2023 16:04:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF2/k1TZ1srlxYYCcbd+pG0n7roggojkjsAq7KZfp+xHHzCQUh3PpY20vuSGkhLKuBdesle X-Received: by 2002:a05:6a20:a104:b0:14c:6404:7c5e with SMTP id q4-20020a056a20a10400b0014c64047c5emr11432842pzk.24.1694473489969; Mon, 11 Sep 2023 16:04:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694473489; cv=none; d=google.com; s=arc-20160816; b=eJmJEoeCd5NLI4T1P+7frEBhFMhIexsjNGmrmmhjxPbq5B2T9IBfspOKyQ+SqYAETc WK6EU7W1zqceloMJCHHTt25MSTNt3TUvAOUL5SZBGulgPPva2d62G7bjMFUVBbFiPM6F STVbLcDnfL7PMDv0RdpdFWpOQyw9sOVKBCUHBE7YCJBQjSW6pLnvAOzlmatudDM+e/EJ fE9GuiPQLNnvc6VvB7tqAp75kWPCkncF5bDbxNaipCQgLy8GUh5uQSbfQyT4QupwlFCh U+G4jbFa/2TsbfhLM3dzNxfX164wwdwt2mYL9AJsONZlAQRSBdli4IcNiqZGvg+2LJbV DnuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from; bh=aozesofd0H8RmKp7jTbMyRJGvFmXYyigRajHSsKCYp0=; fh=UP/O5DRRFRgUiZC1OP80L0qSlgKcpb+pw3WI3B3cQYw=; b=xLHnLGYViosLvZxFpX1XoemGqHO0/EWMHxWecFLk8xtmf89adznjNEs+owdHx8eu4U M4KRCxpumecLEn8acNmpwyicVn71bckusUHrbGrvApobTJbfJhKbXkGcJ1KjIBS2Qm3J VbC+DLbKjurm1+c8zOoz/A49KA6KGMI8A/E1sPneMwLlcSgfVU10dkrOnNYui7wRWWqr VzGc7LOURnnferW9fhe3z/HXD+HvncS91cBZPCfc5nwDoEJ9Xz94+V9PMqmjIO2werb7 q0SNSAxb6RPymY08CGN4N/rDyCzFpqu9xXoCNGF1Cb9e/J1TxJAXDR9PSdIDGYUTyFIa 815w== 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 k73-20020a636f4c000000b00573f8a5337esi6930652pgc.461.2023.09.11.16.04.24; Mon, 11 Sep 2023 16:04:49 -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 S1349112AbjIKVci (ORCPT + 90 others); Mon, 11 Sep 2023 17:32:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236525AbjIKKu2 (ORCPT ); Mon, 11 Sep 2023 06:50:28 -0400 Received: from SHSQR01.spreadtrum.com (mx1.unisoc.com [222.66.158.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 694AEE9 for ; Mon, 11 Sep 2023 03:50:22 -0700 (PDT) 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-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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: INBOX X-GMAIL-THRID: 1776784234564022041 X-GMAIL-MSGID: 1776784234564022041 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 --- 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;