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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 E646AC432BE for ; Thu, 5 Aug 2021 12:56:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7E63D60525 for ; Thu, 5 Aug 2021 12:56:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7E63D60525 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linutronix.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id CBB218D0001; Thu, 5 Aug 2021 08:56:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C438F6B0071; Thu, 5 Aug 2021 08:56:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B0C898D0001; Thu, 5 Aug 2021 08:56:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0239.hostedemail.com [216.40.44.239]) by kanga.kvack.org (Postfix) with ESMTP id 964746B006C for ; Thu, 5 Aug 2021 08:56:56 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 406FE8249980 for ; Thu, 5 Aug 2021 12:56:56 +0000 (UTC) X-FDA: 78441026832.26.7B595E4 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf20.hostedemail.com (Postfix) with ESMTP id D570AD0000B0 for ; Thu, 5 Aug 2021 12:56:55 +0000 (UTC) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1628168213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RVf3PfykKYQU3CTBy9ZESamUrkWVChfXxQyzL80BiXo=; b=peYGOaIZKlNcKu82FZ+29EvQTK9tEiX9kAm7iStGMPWHKrfF5CKz0fUUr3DKoGChDSRNhZ W2onQknbLQQk9eXa7/bsxV7qyF7xILLb6R0/dqSl2cCCULJFViJD8v3Q/R1oazJYnq5ttu Ei9HChS0r0EJBqGLLS4KaqThoDy/M1Noqi7u4D7CKVIaBDtlhRIMTIsKd7P2k6e2CGX6oC 1cx9E60OjNHEn88P88FtxNrD2vjNChOuX9B/4HZSq3qK6xmwh+KZLif0ShScod+k3krRlu n5FISmyIo33SzWJX78HtSQqcqKaqdBHSUz+piX+WjM69mbBp64XvpMjwrHh/hw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1628168213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RVf3PfykKYQU3CTBy9ZESamUrkWVChfXxQyzL80BiXo=; b=lGkYg8f60GgKq3ZFgWC+c4sOHP6+KK3gi0j7kzgpuabkhVPPQbRS3Os2psr65fU4LDaRk3 Hm9RSNyD5dvCB+BQ== To: Mel Gorman , Vlastimil Babka Cc: Andrew Morton , Ingo Molnar , Hugh Dickins , Linux-MM , Linux-RT-Users , LKML , Peter Zijlstra Subject: Re: [PATCH 2/2] mm/vmstat: Protect per cpu variables with preempt disable on RT In-Reply-To: <20210804142306.GE6464@techsingularity.net> References: <20210723100034.13353-1-mgorman@techsingularity.net> <20210723100034.13353-3-mgorman@techsingularity.net> <87czqu2iew.ffs@tglx> <20210804095425.GA6464@techsingularity.net> <91b2f893-eb6a-d91d-3769-baba8601b0f6@suse.cz> <20210804142306.GE6464@techsingularity.net> Date: Thu, 05 Aug 2021 14:56:53 +0200 Message-ID: <87h7g4123u.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=peYGOaIZ; dkim=pass header.d=linutronix.de header.s=2020e header.b=lGkYg8f6; spf=pass (imf20.hostedemail.com: domain of tglx@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=tglx@linutronix.de; dmarc=pass (policy=none) header.from=linutronix.de X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: D570AD0000B0 X-Stat-Signature: xjoiofx6xqaarxuymchs1frkgnh89kaj X-HE-Tag: 1628168215-307906 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 Wed, Aug 04 2021 at 15:23, Mel Gorman wrote: Mel, > On Wed, Aug 04, 2021 at 03:42:25PM +0200, Vlastimil Babka wrote: >> The idea was not build-time, but runtime (hidden behind lockdep, VM_DEBUG or >> whatnot), i.e.: >> >> what that code needs is switch(item) { case foo1: case foo2: >> lockdep_assert_irqs_disabled(); break; case bar1: case bar2: >> lockdep_assert_preempt_disabled(); lockdep_assert_no_in_irq(); break; } or >> something along those lines >> > Ok, that would potentially work. It may not even need to split the stats > into different enums. Simply document which stats need protection from > IRQ or preemption and use PROVE_LOCKING to check if preemption or IRQs > are disabled depending on the kernel config. I don't think it gets rid > of preempt_disable_rt unless the API was completely reworked with entry > points that describe the locking requirements. That would be tricky > because the requirements differ between kernel configurations. Right. This won't get rid of the preempt disabling on RT, but I think we should rather open code this if (IS_ENABLED(CONFIG_PREEMPT_RT)) preempt_dis/enable(); instead of proliferating these helper macros which have only one user left. Thanks, tglx