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 X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D533C43464 for ; Fri, 18 Sep 2020 12:02:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CF51120848 for ; Fri, 18 Sep 2020 12:02:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726591AbgIRMCr (ORCPT ); Fri, 18 Sep 2020 08:02:47 -0400 Received: from mx2.suse.de ([195.135.220.15]:35560 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726121AbgIRMCr (ORCPT ); Fri, 18 Sep 2020 08:02:47 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 2A018ADAD; Fri, 18 Sep 2020 12:03:20 +0000 (UTC) Subject: Re: [RFC 4/5] mm, page_alloc: cache pageset high and batch in struct zone To: Oscar Salvador Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Michal Hocko , Pavel Tatashin , David Hildenbrand , Joonsoo Kim References: <20200907163628.26495-1-vbabka@suse.cz> <20200907163628.26495-5-vbabka@suse.cz> <20200910113046.GA5848@linux> From: Vlastimil Babka Message-ID: <08421531-1df0-3cea-fe44-2e4e30808dfd@suse.cz> Date: Fri, 18 Sep 2020 14:02:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200910113046.GA5848@linux> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/10/20 1:30 PM, Oscar Salvador wrote: > On Mon, Sep 07, 2020 at 06:36:27PM +0200, Vlastimil Babka wrote: > */ >> -static void setup_pageset(struct per_cpu_pageset *p); >> +static void pageset_init(struct per_cpu_pageset *p); > > this belongs to the respective patches Right, thanks. >> -static void zone_set_pageset_high_and_batch(struct zone *zone) >> +static void zone_set_pageset_high_and_batch(struct zone *zone, bool force_update) >> { >> unsigned long new_high; >> unsigned long new_batch; >> @@ -6256,6 +6256,14 @@ static void zone_set_pageset_high_and_batch(struct zone *zone) >> new_batch = max(1UL, 1 * new_batch); >> } >> >> + if (zone->pageset_high != new_high || >> + zone->pageset_batch != new_batch) { >> + zone->pageset_high = new_high; >> + zone->pageset_batch = new_batch; >> + } else if (!force_update) { >> + return; >> + } > > I am probably missimg something obvious, so sorry, but why do we need > force_update here? > AFAICS, we only want to call pageset_update() in case zone->pageset_high/batch > and the new computed high/batch differs, so if everything is equal, why do we want > to call it anyways? My reasoning is that initially we don't have guarantee that zone->pageset_high/batch matches the respective pcp->high/batch. So we could detect no change in the zone values and return, but leave the pcp value incoherent. But now I think it could be achieved also in a simpler way, so I'll try.