Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp738271pxt; Thu, 5 Aug 2021 10:22:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTKBfmHqZ+ZRDXILZKVAj7r91KVl15yNQmaG5vIw8oS00P1fS6hgCd9wSswMk/DKAXWzrY X-Received: by 2002:a05:6638:3a12:: with SMTP id j18mr5856782jaj.75.1628184163661; Thu, 05 Aug 2021 10:22:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628184163; cv=none; d=google.com; s=arc-20160816; b=FGgMEZjJ6c80q8ZzuDB6kBmvuGLFTXjF/5BHmzlCJnplAD89ep0gJu+ICP3xe+Z3r3 PllZGVWqhrqPbzMwVxM0L3NeznTcnD+8bksVkCrNnsXKHDMKvXt0JZo7pDUKKLxvpC4L XZIT9OX0QMOLmiM4pUgMVj9WwAsXQEzRzwpZB6CJtvviCCwo6z/Gct5tiRfcnnxIMMK/ 7fec21jx1YW58t/pu4MRAuxjtFwihrXa8XqvlQkzrQNgqOLcYyuoKPf5ylz/cxvyOFeP C2VYaCcYnPLb4gxVDtzNAtAGFBB23IoQUEvaykLvcmK1LO9cgo+SxsAK7k5DQ8rgx7g3 m47w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=RVf3PfykKYQU3CTBy9ZESamUrkWVChfXxQyzL80BiXo=; b=QyIMtXzuBdtshlvgU12DiqseF1aDNw/TrejIfXHdrEvGfO3A+JVaH7W0+Fgv+qeGxI 9hXezWA33KnFDezOkxtfLpTo640D/iWIwnociJQyyqmEAm9fVg3wi/PDviTLI81D0nDC 3OTDb0BpgqNjSZCMrBsPmtL8Ix2DzqzO6Rt2FMiDYJudbNZ6IpWftTxDf+MXdaqTUnac CpxJVX3obnLdY9j0PDFmkaNPEmLuvVXI1vNU9jbNH0Zo+5YEe8gLmTlheswfBkuozuG0 pSQtzswcF3c7poTN32kKWpTa1JZ5WUf4WXntYjw8wSry6NO1uDy/56Yg1rot6DH3yRWx mjcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=peYGOaIZ; dkim=neutral (no key) header.i=@linutronix.de header.b=lGkYg8f6; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s9si5702068iov.76.2021.08.05.10.22.30; Thu, 05 Aug 2021 10:22:43 -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; dkim=pass header.i=@linutronix.de header.s=2020 header.b=peYGOaIZ; dkim=neutral (no key) header.i=@linutronix.de header.b=lGkYg8f6; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241537AbhHEM5K (ORCPT + 99 others); Thu, 5 Aug 2021 08:57:10 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:42778 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232615AbhHEM5J (ORCPT ); Thu, 5 Aug 2021 08:57:09 -0400 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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