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 7F422C43334 for ; Fri, 8 Jul 2022 15:58:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1F45A6B0073; Fri, 8 Jul 2022 11:58:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1A5AB6B0074; Fri, 8 Jul 2022 11:58:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 093C76B0075; Fri, 8 Jul 2022 11:58:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id EE1B86B0073 for ; Fri, 8 Jul 2022 11:58:39 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id CEE0534A8D for ; Fri, 8 Jul 2022 15:58:39 +0000 (UTC) X-FDA: 79664390358.10.D14B0A0 Received: from outbound-smtp07.blacknight.com (outbound-smtp07.blacknight.com [46.22.139.12]) by imf10.hostedemail.com (Postfix) with ESMTP id 09EDDC001E for ; Fri, 8 Jul 2022 15:58:38 +0000 (UTC) Received: from mail.blacknight.com (pemlinmail01.blacknight.ie [81.17.254.10]) by outbound-smtp07.blacknight.com (Postfix) with ESMTPS id 38D531C3F77 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) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657295919; 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: in-reply-to:in-reply-to:references:references; bh=X2CxK5pYfayom6NzVYJ1W5OyczFFLezOd0Vdyew9zKA=; b=qiVqzj3qYe0n5XXgPzxj+quWZ+E5fxDu5JPM85DEP0Qvu3FO0S8SVKVZX5ypD3m0unrvIr yu0Ruv1Z45Nj5Qn+suF6Ez0Err0FY1gYBd5mn8+HJhuS5YmGuao+eiDO7nOObj3oNnl1WA 2ohBVpdqDTPhMtjVDfdpPTQR7BkWLhI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657295919; a=rsa-sha256; cv=none; b=Rg+F3O3Zw3700cUaN9VJOeUXZBHuzzDhpoig7ZXybZ7ZmfEcsZGvMRLLM3gwcE9mr+GSej ohO4cViBe69bBqM9jl1bDhQ3bclakVAqqpuXPNzxV1fijamRUOfkOtNBsc3clRM1iluT+V Yy4aw23FQleF10gNEniu7UqYZT3MXoI= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=none; spf=pass (imf10.hostedemail.com: domain of mgorman@techsingularity.net designates 46.22.139.12 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net; dmarc=none X-Rspamd-Queue-Id: 09EDDC001E Authentication-Results: imf10.hostedemail.com; dkim=none; spf=pass (imf10.hostedemail.com: domain of mgorman@techsingularity.net designates 46.22.139.12 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net; dmarc=none X-Rspam-User: X-Rspamd-Server: rspam06 X-Stat-Signature: 7nchrbaa5wdrnfm5kyfoau6zxpdz7wzx X-HE-Tag: 1657295918-547288 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 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