From mboxrd@z Thu Jan 1 00:00:00 1970 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 84BF2ECAAD3 for ; Fri, 9 Sep 2022 11:26:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1DEBE8D0003; Fri, 9 Sep 2022 07:26:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 18E498D0002; Fri, 9 Sep 2022 07:26:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 008968D0003; Fri, 9 Sep 2022 07:26:31 -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 E5BD88D0002 for ; Fri, 9 Sep 2022 07:26:31 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id BD49312135C for ; Fri, 9 Sep 2022 11:26:31 +0000 (UTC) X-FDA: 79892318982.13.5228D8A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf28.hostedemail.com (Postfix) with ESMTP id 6DD22C00A9 for ; Fri, 9 Sep 2022 11:26:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662722791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kR/RcJLHJFia6a8A9ACmf1sg9LF38Xuw8q80+jnlzbY=; b=izVmjnRcnsY6ocTEoI8XZOXhXxVXwSTyr6LGndDfhmR3AWACxYPHDA2mzuoYLPytnW++sy vckD9RHs9v3fhH4Um5ZkukepmwmDrvFlxIDDro1thWykat9SiRY9OYA8z5Bb2QCAVSlXfG 67S2YtDE3Hh/zf6fgNPUJV+XgEixhNI= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-468-Q-sMiX48NnuoXeC8T4Op_Q-1; Fri, 09 Sep 2022 07:26:30 -0400 X-MC-Unique: Q-sMiX48NnuoXeC8T4Op_Q-1 Received: by mail-wr1-f71.google.com with SMTP id a13-20020adfbc4d000000b00228631ddfafso279979wrh.9 for ; Fri, 09 Sep 2022 04:26:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date; bh=kR/RcJLHJFia6a8A9ACmf1sg9LF38Xuw8q80+jnlzbY=; b=gFnLSLJZxxtX8PvGjo6xv8Dil67HD6mcYVVQfZHdhIM4Pt3TCQecJnBZj1Q9y1SeJs BlXDDPn/La9CJ3m7msRunFiTTUSpmPuF+4O92d0Pd7yfVa3ObcnVvRfHK+zMVYIQwsta yjTwNd1qx8hIcB4bYeBzi3Z9sqFAniMH2lLJcUcsAovixGn2VoQBbpa1ThInuA0kdQjR ZnH3bZKPcRW7D0eaVR9O+FCWjPhECHklQNGys/T7Dor+LCfHZj7sqMys+xEoPB/kpXm4 tzhg7kQ759E+RHcz6OYSJcmtEetGe8dWnMKgkZReyr5QX5jdUBoWsPrVeR04ESRwBgo1 5l5Q== X-Gm-Message-State: ACgBeo21ct9Ft82LJPxyswykWFKHYB8hivV3QcVU1wSzLXkfyDQ/0PDb 5JMFL6aZPz/6DFd9105c+yNX7NYrtDD0aUJZHDc3byN1l3LpwT940uKTTQpc9hPEwGyUc7MoBay YtV6sHjfv0zM= X-Received: by 2002:a5d:540a:0:b0:22a:35f1:2d61 with SMTP id g10-20020a5d540a000000b0022a35f12d61mr3412111wrv.535.1662722788785; Fri, 09 Sep 2022 04:26:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR62UifyovjdPp3tDA4qvJpx07dZgSWFKthlevjwUzAF2jmh5ifmuo5h4yToY37AdrztkDwMxg== X-Received: by 2002:a5d:540a:0:b0:22a:35f1:2d61 with SMTP id g10-20020a5d540a000000b0022a35f12d61mr3412096wrv.535.1662722788480; Fri, 09 Sep 2022 04:26:28 -0700 (PDT) Received: from ?IPV6:2003:cb:c704:6300:1fe0:42e1:62c5:91b6? (p200300cbc70463001fe042e162c591b6.dip0.t-ipconnect.de. [2003:cb:c704:6300:1fe0:42e1:62c5:91b6]) by smtp.gmail.com with ESMTPSA id z12-20020a5d654c000000b00228e1e90822sm237846wrv.112.2022.09.09.04.26.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Sep 2022 04:26:27 -0700 (PDT) Message-ID: Date: Fri, 9 Sep 2022 13:26:27 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH 02/16] mm/page_alloc: make zone_pcp_update() static To: Miaohe Lin , akpm@linux-foundation.org Cc: osalvador@suse.de, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20220909092451.24883-1-linmiaohe@huawei.com> <20220909092451.24883-3-linmiaohe@huawei.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20220909092451.24883-3-linmiaohe@huawei.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=izVmjnRc; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf28.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662722791; a=rsa-sha256; cv=none; b=GMJpvySPrE+weTjF5s7dBLOU6wdaSsIx8Nl/vQrLb/gDLw3PjDF7it88V9qaC12BCTdwv7 IWsz61ETf/GzBOM0p01Vh6uKfrpHDLEAJrvATogKFlrZkjym1OUikFEQcl2PRo3eR9B3aZ pZeTYhV5UkAQ56PRuNFCmCfFG/HFYFA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662722791; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=kR/RcJLHJFia6a8A9ACmf1sg9LF38Xuw8q80+jnlzbY=; b=2hzrGEIiw7uYofFFuOoFejwNKAH/JDpEKLC1qrUmwHHgIjrQIuVpY5kuVjybq2C2KP6/jO ijDz2OKATUknMxrvBjPlV5qSpVXpAfoqxBYfvwvIXtPaM21Z8NbBU0cMZ2ZqPJ/sTCbTYB 1GVf7Lw782QAQ/DkMcWz1RWnJdIxOhs= Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=izVmjnRc; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf28.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com X-Rspam-User: X-Rspamd-Server: rspam01 X-Stat-Signature: 5nj75kt47iw91sn5amhmr1t6b1xqt75b X-Rspamd-Queue-Id: 6DD22C00A9 X-HE-Tag: 1662722791-503948 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: On 09.09.22 11:24, Miaohe Lin wrote: > Since commit b92ca18e8ca5 ("mm/page_alloc: disassociate the pcp->high > from pcp->batch"), zone_pcp_update() is only used in mm/page_alloc.c. > Move zone_pcp_update() up to avoid forward declaration and then make > it static. No functional change intended. > > Signed-off-by: Miaohe Lin > --- > mm/internal.h | 1 - > mm/page_alloc.c | 22 +++++++++++----------- > 2 files changed, 11 insertions(+), 12 deletions(-) > > diff --git a/mm/internal.h b/mm/internal.h > index 4e5f3d0d5538..2424fcde6538 100644 > --- a/mm/internal.h > +++ b/mm/internal.h > @@ -367,7 +367,6 @@ extern int user_min_free_kbytes; > extern void free_unref_page(struct page *page, unsigned int order); > extern void free_unref_page_list(struct list_head *list); > > -extern void zone_pcp_update(struct zone *zone, int cpu_online); > extern void zone_pcp_reset(struct zone *zone); > extern void zone_pcp_disable(struct zone *zone); > extern void zone_pcp_enable(struct zone *zone); > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 4b97a03fa2dd..2deac2fe3372 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -7238,6 +7238,17 @@ void __meminit setup_zone_pageset(struct zone *zone) > zone_set_pageset_high_and_batch(zone, 0); > } > > +/* > + * The zone indicated has a new number of managed_pages; batch sizes and percpu > + * page high values need to be recalculated. > + */ > +static void zone_pcp_update(struct zone *zone, int cpu_online) > +{ > + mutex_lock(&pcp_batch_high_lock); > + zone_set_pageset_high_and_batch(zone, cpu_online); > + mutex_unlock(&pcp_batch_high_lock); > +} > + > /* > * Allocate per cpu pagesets and initialize them. > * Before this call only boot pagesets were available. > @@ -9469,17 +9480,6 @@ void free_contig_range(unsigned long pfn, unsigned long nr_pages) > } > EXPORT_SYMBOL(free_contig_range); > > -/* > - * The zone indicated has a new number of managed_pages; batch sizes and percpu > - * page high values need to be recalculated. > - */ > -void zone_pcp_update(struct zone *zone, int cpu_online) > -{ > - mutex_lock(&pcp_batch_high_lock); > - zone_set_pageset_high_and_batch(zone, cpu_online); > - mutex_unlock(&pcp_batch_high_lock); > -} > - > /* > * Effectively disable pcplists for the zone by setting the high limit to 0 > * and draining all cpus. A concurrent page freeing on another CPU that's about Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb