Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp692668pxf; Thu, 8 Apr 2021 10:49:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxO6MzO7h1yy5lLyTZanJ9pafaBGUknIIkUV4UgExOUYZeBBk5jN+qjfimM0otGZQ8+o6en X-Received: by 2002:a05:6402:5205:: with SMTP id s5mr10151575edd.65.1617904175981; Thu, 08 Apr 2021 10:49:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617904175; cv=none; d=google.com; s=arc-20160816; b=zjttG7BxGPEXIgxqguHUlHFbtcXeDqCCznsgZlw6B9EQpPpBwc2aLn9P8iTq8JIDWr C7gNy5dpPG+ipBAXzVQOhGn4ygNwbkMRjf/wnC+iN1DSSadziGAj4U7VGivVv3UHRXpu SywMWiFfnvUqFEu5QCeCn91uAXL4eEqRpGq9IJGA0kHZM9hy89Vs/1JqFm6SphmW6R99 8GeaYRYh9kQICAOcj7GRB9ZvhI2hJCWiRX38t+SNY/D9b4MnK1iXXJ5jV7gqhpoubRTJ Jk+fGiwb0QQhqL3WPewNvO/0TVJ0sg45Q5WxbZNm+Pzi9AI6GuNWPbPDu9+LCbjiM07T LBaA== 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=zHTP6BjoBXEWbabZ6Bputbm7jL5s/OnsUSrsqDHil6M=; b=Q5QN+cm+BHdk33U5JV6JMp7fU0lP9A+pICZMbf0od2q/OriD+qNRNeFYp5grOchMaW H7gJxW2nlh3LQi0XitQt1fN800Tt1LnxoMvGlMULNrb84DHw60/b/K9W1Udllx1ELQ4S JKrnF2f5cnNUy2NjMTO5+oRMtcZ6kvZIgisyhBh84bYVs/naCBgZka5x7em3caAI9sjk cIB08NNEagX4vkJ82lqnsTcwUQ/GXLrvOnwJyNl3Bfv169fsMmzAFkiKK5DZCQGNqk4X WoShKDAAWfdSLVOxvl4GEMwIVIrGPsJPOR7xkz077je0BXjbtTBl8hZKrxiWFJRIf7Tc 7UWw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id an16si4535546ejc.39.2021.04.08.10.49.12; Thu, 08 Apr 2021 10:49:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232644AbhDHRsV (ORCPT + 99 others); Thu, 8 Apr 2021 13:48:21 -0400 Received: from outbound-smtp30.blacknight.com ([81.17.249.61]:60983 "EHLO outbound-smtp30.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232552AbhDHRsT (ORCPT ); Thu, 8 Apr 2021 13:48:19 -0400 Received: from mail.blacknight.com (pemlinmail06.blacknight.ie [81.17.255.152]) by outbound-smtp30.blacknight.com (Postfix) with ESMTPS id 5FEF8BAA42 for ; Thu, 8 Apr 2021 18:48:06 +0100 (IST) Received: (qmail 27078 invoked from network); 8 Apr 2021 17:48:06 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.22.4]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 8 Apr 2021 17:48:06 -0000 Date: Thu, 8 Apr 2021 18:48:04 +0100 From: Mel Gorman To: Peter Zijlstra Cc: Linux-MM , Linux-RT-Users , LKML , Chuck Lever , Jesper Dangaard Brouer , Matthew Wilcox , Thomas Gleixner , Ingo Molnar , Michal Hocko , Oscar Salvador Subject: Re: [PATCH 0/11 v2] Use local_lock for pcp protection and reduce stat overhead Message-ID: <20210408174804.GH3697@techsingularity.net> References: <20210407202423.16022-1-mgorman@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) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 08, 2021 at 12:56:01PM +0200, Peter Zijlstra wrote: > On Wed, Apr 07, 2021 at 09:24:12PM +0100, Mel Gorman wrote: > > Why local_lock? PREEMPT_RT considers the following sequence to be unsafe > > as documented in Documentation/locking/locktypes.rst > > > > local_irq_disable(); > > raw_spin_lock(&lock); > > Almost, the above is actually OK on RT. The problematic one is: > > local_irq_disable(); > spin_lock(&lock); > > That doesn't work on RT since spin_lock() turns into a PI-mutex which > then obviously explodes if it tries to block with IRQs disabled. > > And it so happens, that's exactly the one at hand. Ok, I completely messed up the leader because it was local_irq_disable() + spin_lock() that I was worried about. Once the series is complete, it is replated with local_lock_irq(&lock_lock) spin_lock(&lock); According to Documentation/locking/locktypes.rst, that should be safe. I'll rephrase the justification. -- Mel Gorman SUSE Labs