Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp5086336rwb; Tue, 8 Aug 2023 20:46:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHXc3/nkIYwvPCRsdwY+1GXXUOpxxHpCO1/gXh/PxocIF6EGgTiqEuKJUBN1CJcnvNF1Ut4 X-Received: by 2002:a17:90b:1284:b0:267:f66a:f25f with SMTP id fw4-20020a17090b128400b00267f66af25fmr1196422pjb.11.1691552780671; Tue, 08 Aug 2023 20:46:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691552780; cv=none; d=google.com; s=arc-20160816; b=sHkCU7Zj0bWYEr3lKt+lYXticq1vhfsZIWbzur5IFk+jex7xEAC2G5shXS0E9wevOv AHtHFhM6n3EfYCtqCbnGJZ8OwIbokNAlbkkTf8wAG5IEJQQv3wIMuwcfkweTb3qIm6iY Tdd+pU8RJEszQbHRdEjEG9gpYVBgbN8FYvMl1laea5vzu6N4x6ZQL8CAuK5pdoPX0jJX D21O+yBz1Erc/DLWzV91MIqX47xSl1Wyx7/vuudDbzU8oa8Jxc95DFqQm1dpbJUtXbjP rr20d4/BxaVzwQCwapb+T65Fkbck41RaZBqKoB6iDPevKNmo/qCBUl7FGt99BkKyEMzX 6irw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=VJ34kD3FHV8oFdywL+Y0vzWD/8e4pWr1LeA0o59femk=; fh=7OUidGM7uWbpAl8VTxhM9W4yciPE2x0Gkm1foXEeriw=; b=Zb78QjwUu1hTIfYp6AgSy98uXpZnk2gukeG6QlzgEzAJxF6F0ksG0TMOXpIl51sZoA lW0QzZxAUzV2ArNZnYsqhjFYYBCdNA9W75uIoNCeGKe3xC8dwMyrPqgEIy3UYRnmSzbm bdvz1cfI3xdpqPCUqfeU7WeyGX7LmAhJa/m3CKh6HJ4iRwYPF9FiRotLIVCBBdWpAid3 dmk+F4KmB45+u12+5jR0G7igf/mbqdhxMPlZ/zuWN7wg5sOFAjgKNgRKFaBkS+AGhh5y 4+wv3S8weLQJ7HZ74Ldd8WfqiQ5kYIsxQfa8W2E22odJmExwM5G8cRs2nkwmWUj50hgt u1NA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cq10-20020a17090af98a00b0026841a42bffsi539397pjb.139.2023.08.08.20.46.08; Tue, 08 Aug 2023 20:46:20 -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 S230144AbjHICHw (ORCPT + 99 others); Tue, 8 Aug 2023 22:07:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229881AbjHICHt (ORCPT ); Tue, 8 Aug 2023 22:07:49 -0400 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E481C1BCE for ; Tue, 8 Aug 2023 19:07:48 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4RLD3P62PCz4f3q2n for ; Wed, 9 Aug 2023 10:07:45 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP2 (Coremail) with SMTP id Syh0CgBXem7v9NJkFAkTAQ--.60414S4; Wed, 09 Aug 2023 10:07:46 +0800 (CST) From: Kemeng Shi To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, baolin.wang@linux.alibaba.com, mgorman@techsingularity.net, david@redhat.com, willy@infradead.org Cc: shikemeng@huaweicloud.com Subject: [PATCH 2/2] mm/page_alloc: remove unnecessary parameter batch of nr_pcp_free Date: Wed, 9 Aug 2023 18:07:54 +0800 Message-Id: <20230809100754.3094517-3-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230809100754.3094517-1-shikemeng@huaweicloud.com> References: <20230809100754.3094517-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: Syh0CgBXem7v9NJkFAkTAQ--.60414S4 X-Coremail-Antispam: 1UD129KBjvJXoW7ZFyDGF47KFykZrW8Jw13Jwb_yoW8JFW8pF 93Kwn7KFWkWwn8G39rJF4qk34jka1rKFZ3K3yfW345XF13CryIkFyIyryDWF18KrykCFs7 CrZ5t34rZa1UXaUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUPab4IE77IF4wAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M2 8IrcIa0xkI8VA2jI8067AKxVWUXwA2048vs2IY020Ec7CjxVAFwI0_Gr0_Xr1l8cAvFVAK 0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVWDJVCq3wA2z4 x0Y4vE2Ix0cI8IcVCY1x0267AKxVWxJr0_GcWl84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2 z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4 xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v2 6r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6I AqYI8I648v4I1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAq x4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1q6r 43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF 7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxV WUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjTR QNVDUUUUU X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE 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 We get batch from pcp and just pass it to nr_pcp_free immediately. Get batch from pcp inside nr_pcp_free to remove unnecessary parameter batch. Signed-off-by: Kemeng Shi --- mm/page_alloc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 1ddcb2707d05..bb1d14e806ad 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2376,10 +2376,10 @@ static bool free_unref_page_prepare(struct page *page, unsigned long pfn, return true; } -static int nr_pcp_free(struct per_cpu_pages *pcp, int high, int batch, - bool free_high) +static int nr_pcp_free(struct per_cpu_pages *pcp, int high, bool free_high) { int min_nr_free, max_nr_free; + int batch = READ_ONCE(pcp->batch); /* Free everything if batch freeing high-order pages. */ if (unlikely(free_high)) @@ -2446,9 +2446,7 @@ static void free_unref_page_commit(struct zone *zone, struct per_cpu_pages *pcp, high = nr_pcp_high(pcp, zone, free_high); if (pcp->count >= high) { - int batch = READ_ONCE(pcp->batch); - - free_pcppages_bulk(zone, nr_pcp_free(pcp, high, batch, free_high), pcp, pindex); + free_pcppages_bulk(zone, nr_pcp_free(pcp, high, free_high), pcp, pindex); } } -- 2.30.0