Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3646373iog; Tue, 21 Jun 2022 03:05:10 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tSzgj9yuI71sJD5DFfurSV/xL/s9MvM4PViz9abMNgU89tN2tMRJczMJCHCNPOW5M82l20 X-Received: by 2002:a17:906:5305:b0:712:388c:2bf5 with SMTP id h5-20020a170906530500b00712388c2bf5mr25456569ejo.559.1655805910360; Tue, 21 Jun 2022 03:05:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655805910; cv=none; d=google.com; s=arc-20160816; b=Hqa0wLouEYXDam4+qH7Za70v/Ct9Xy7N162TuE2gMaOEFzkpEUV6ayVrFGiVIFknKH kDe4mRp2y3jsbb1zfesnBZZ4tYSlvQVI8dQVyibtes49LmGW0jz73GvnPbmpEffrfxWw 6eUr6EdNhem0553vp55mswPCQxTjHM5Q1drZEur37SrwoHHAonqQEhJyMPkjQbrCJ7R7 opvK7zxRO74EHBW7kBDRN2ajk1w7J2vrUsHeNOzDBuRpewuJb39E4rkN4+PyGkCrpaYI k57HaoGZZCv3Q4WV0oJNxF9dKvyg7FV/ezQ/K92EVy/vNZpAmGQcLmkF8CtrF2MIduuq uYzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=vDZ4GXiPRXCENkGYCnV9I/7G2c6VByhbNrd+uG4xkbw=; b=IMvofqOLd2GGcfSC99lwII2M5rVxwPxuVODDfQX0fCPbG9Gq0U3F9RXCw8A7BOKL3Z rxLiyVm43t51XG8XjbwE2azuOfkc6BzsuPyTEVaUGu3EPmSkILfXkoHcXBWQ3UZJkdWW tFvyC/o09/q0i3oF4a4Dw59HfJ0/KrfYx3UzGMbaK0raSAfdba79sZo0oZroSuZQz7h3 6I4kT+H/uqfxSqUSpSgiokNZApJhotgGsBm7iuPUfNElHTKohtAUXNG6B6QRf2JrCzVG lH7SxzBRqtxUp8w7wjn2+tKiw2CaF2hCkzfmTGcJ0xkdxsMdRfy04cuew9iWiBnM+EN8 7e3g== 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 ht20-20020a170907609400b006fec271359asi13546310ejc.57.2022.06.21.03.04.44; Tue, 21 Jun 2022 03:05:10 -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 S1347543AbiFUJ1f (ORCPT + 99 others); Tue, 21 Jun 2022 05:27:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347480AbiFUJ1d (ORCPT ); Tue, 21 Jun 2022 05:27:33 -0400 Received: from outbound-smtp55.blacknight.com (outbound-smtp55.blacknight.com [46.22.136.239]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32171248DA for ; Tue, 21 Jun 2022 02:27:32 -0700 (PDT) Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp55.blacknight.com (Postfix) with ESMTPS id B4102FAFE7 for ; Tue, 21 Jun 2022 10:27:30 +0100 (IST) Received: (qmail 7506 invoked from network); 21 Jun 2022 09:27:30 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.198.246]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 21 Jun 2022 09:27:30 -0000 Date: Tue, 21 Jun 2022 10:27:28 +0100 From: Mel Gorman To: Vlastimil Babka Cc: Yu Zhao , Andrew Morton , Nicolas Saenz Julienne , Marcelo Tosatti , Michal Hocko , Hugh Dickins , LKML , Linux-MM Subject: Re: [PATCH 7/7] mm/page_alloc: Replace local_lock with normal spinlock Message-ID: <20220621092728.GE15453@techsingularity.net> References: <20220613125622.18628-1-mgorman@techsingularity.net> <20220613125622.18628-8-mgorman@techsingularity.net> <43033655-2e78-621b-cc76-c3dc53024d00@suse.cz> <8354ba5b-d1ce-90c7-be76-328ab9321550@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <8354ba5b-d1ce-90c7-be76-328ab9321550@suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Fri, Jun 17, 2022 at 09:57:06AM +0200, Vlastimil Babka wrote: > On 6/16/22 23:07, Yu Zhao wrote: > > On Thu, Jun 16, 2022 at 11:02 AM Vlastimil Babka wrote: > >> > >> > >> > @@ -3794,19 +3805,29 @@ static struct page *rmqueue_pcplist(struct zone *preferred_zone, > >> > struct list_head *list; > >> > struct page *page; > >> > unsigned long flags; > >> > + unsigned long __maybe_unused UP_flags; > >> > > >> > - local_lock_irqsave(&pagesets.lock, flags); > >> > + /* > >> > + * spin_trylock_irqsave is not necessary right now as it'll only be > >> > + * true when contending with a remote drain. It's in place as a > >> > + * preparation step before converting pcp locking to spin_trylock > >> > + * to protect against IRQ reentry. > >> > + */ > >> > + pcp_trylock_prepare(UP_flags); > >> > + pcp = pcp_spin_trylock_irqsave(zone->per_cpu_pageset, flags); > >> > + if (!pcp) > >> > >> Besides the missing unpin Andrew fixed, I think also this is missing > >> pcp_trylock_finish(UP_flags); ? > > > > spin_trylock only fails when trylock_finish is a NOP. > > True, so it's not an active bug, but I would still add it, so it's not > confusing and depending on non-obvious details that might later change and > break the code. Yes. Even though it may work, it's still wrong. -- Mel Gorman SUSE Labs