Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp676372imw; Fri, 8 Jul 2022 09:41:12 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v4c+17gF3mIOVAKj4xvOOqQ45mwaWIS9lYXMVRJDMg0WwHBaXWx40q/8629g4EQ8c+B/CX X-Received: by 2002:a05:6402:5408:b0:435:60fa:5017 with SMTP id ev8-20020a056402540800b0043560fa5017mr6014264edb.223.1657298472642; Fri, 08 Jul 2022 09:41:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657298472; cv=none; d=google.com; s=arc-20160816; b=sK6jLKU5+v8/MDW+KFw8rp4SrYBAJVGfvS1wJXTTjPcoU7A4NGFVjfemY563oUbWWT neFEWUS0V32lO19X+Fa/T/UPKCixvQjE/z8mcty+Hv4ILxDSBreoao7a9UbKv/qS49am bsZa3eo7m+e48bKyJSq3jQR8gHjKoaXIX0qnkbKecw5GVogBLZrYYm8KZRmU6Cdd/18b oxGP0p4ALvuikJA9y/3NWcP4/moY/rrEuU048V158CN2Frv+vZ758KmkMur0/Fq6gsuR 1MpHX3Cyz6h94q/ZmwyMz1wKE96pA5SWA9hLU3qas6yUjEHv3JSc0+QePcxS9zg0j2Wk wTQw== 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=X2CxK5pYfayom6NzVYJ1W5OyczFFLezOd0Vdyew9zKA=; b=v8XGw8ck8k/gl6tKX5x0DWgY7bZPLdD2PhFC6QcwQYAt4E5eGk0Q10xR1hIiH2BO4f W0zv8JIo0y9Ofcj4DDuufswvUQMJ2NucAxVYj7tdPAPX8/ueQLTl1we1EnhMjdF2yBxX bY6oGSwT2L+iTQX9G2Uo3MqW06WBs/75J0WcoI8/popDOlVpLJXbfJMX9z56KtY1FJaq MySpRDg49Lby4Rj8/DqWTJCB4VxLHd3jmNNfHE64B/tg9v4pe5yrViumJfFYhI4HkVju ToxecuwlZMgzozky9av/7XDyNrMgBjG2vWRRgs8eTAMlmMGl6gMbELDIiufS78oppO5w ub0Q== 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 jg17-20020a170907971100b006fed9376071si26925060ejc.13.2022.07.08.09.40.44; Fri, 08 Jul 2022 09:41:12 -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 S238878AbiGHP6o (ORCPT + 99 others); Fri, 8 Jul 2022 11:58:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238151AbiGHP6k (ORCPT ); Fri, 8 Jul 2022 11:58:40 -0400 Received: from outbound-smtp26.blacknight.com (outbound-smtp26.blacknight.com [81.17.249.194]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83C815A2F7 for ; Fri, 8 Jul 2022 08:58:38 -0700 (PDT) Received: from mail.blacknight.com (pemlinmail01.blacknight.ie [81.17.254.10]) by outbound-smtp26.blacknight.com (Postfix) with ESMTPS id 30C05CABF0 for ; Fri, 8 Jul 2022 16:58:37 +0100 (IST) Received: (qmail 2989 invoked from network); 8 Jul 2022 15:58:37 -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); 8 Jul 2022 15:58:37 -0000 Date: Fri, 8 Jul 2022 16:58:35 +0100 From: Mel Gorman To: Vlastimil Babka Cc: Andrew Morton , Nicolas Saenz Julienne , Marcelo Tosatti , Michal Hocko , Hugh Dickins , Yu Zhao , Marek Szyprowski , LKML , Linux-MM Subject: Re: [PATCH] mm/page_alloc: replace local_lock with normal spinlock -fix -fix Message-ID: <20220708155835.GK27531@techsingularity.net> References: <20220708144406.GJ27531@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: 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, Jul 08, 2022 at 04:54:47PM +0200, Vlastimil Babka wrote: > On 7/8/22 16:44, Mel Gorman wrote: > > pcpu_spin_unlock and pcpu_spin_unlock_irqrestore both unlock > > pcp->lock and then enable preemption. This lacks symmetry against > > both the pcpu_spin helpers and differs from how local_unlock_* is > > implemented. While this is harmless, it's unnecessary and it's generally > > better to unwind locks and preemption state in the reverse order as > > they were acquired. > > Hm I'm confused, it seems it's done in reverse order (which I agree with) > before this -fix-fix, but not after it? > > before, pcpu_spin_lock() (and variants) do pcpu_task_pin() and then > spin_lock() (or variant), and pcpu_spin_unlock() does spin_unlock() and then > pcpu_task_unpin(). That seems symmetrical, i.e. reverse order to me? And > seems to match what local_lock family does too. > You're not confused, I am. The patch and the changelog are outright brain damage from excessive context switching and a sign that it's time for the weekend to start. Sorry for this absolute misfortune. -- Mel Gorman SUSE Labs