Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1934307imm; Sat, 13 Oct 2018 06:51:46 -0700 (PDT) X-Google-Smtp-Source: ACcGV62e4gp0vAVztoZUuOj/3Pk1ouvfcSyHQDUIJNHkMg81npTqy4uO6tD4tYx+6PHjta0isTm3 X-Received: by 2002:a63:1c64:: with SMTP id c36-v6mr9122244pgm.354.1539438706460; Sat, 13 Oct 2018 06:51:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539438706; cv=none; d=google.com; s=arc-20160816; b=zYVi3hdao2ya3i5/O7h8VTPxRDQjlDnd3fVgBcNOzNvZ9OJv2o1lScpk8or/n8e0yj KpyB5ZiEIno9cL6dPeKN4AGK1+5iw1rW8R6HnDmike+Hm7EDDJzI/pgHFmSTt79qt8N2 lqkBkASgV5ksj4nzdTeYrt3mus+dvxpHUXUjppJJ9f7/QxTF4xehu7qDXuUOou45DcL6 QBapmyfgM2wNmlUI4m0SsbBEqLnNVIbw32HRIbhe9VNVEHW5zjlkadLElyp3fU29swrW o7uWzn/vra2ShyKcp01aBXF/6Z0wPTo1I+o7hOCj0d9+2FKwZAxrrcAL4nsP64vXdo77 6u3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=+XMwMXMjq9ROKzgzKBhLcRtyHTBtbPVhm0+mGC7F25k=; b=V4b13dESxjrag3EZR2db5977YdyV5UGJwjrjBrpzFm5WQdupM01jcVp9LPTvC0t0Sv W7bPBIdGlL0RLMvT1mznatZGWNw1+75lP9W7J9lwumSfPJ4WQVYefkNt63lylX3jOPaV ToP/XXxTOMUG4W++jDMwhImPjHz3vzAr+10o+eZEmPYKqPzTQk9i/E3sriuAYkxKqBsC Y/Ymsn5bqANv3h/Faqq+1oiNw7K8raSu0ZT60aYmjDG+iBiaqAKw5T7/i3kU9xWPx8m4 ivObFp3uZRuEEjHSS67jg+kOUmbbMsTZL2Xt5W29/jmu9bOSty0+/+KZJC8xzDxzWXwG 0/ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=tTG4y1qZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w6-v6si4858764pgm.557.2018.10.13.06.51.31; Sat, 13 Oct 2018 06:51:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=tTG4y1qZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726660AbeJMV2X (ORCPT + 99 others); Sat, 13 Oct 2018 17:28:23 -0400 Received: from merlin.infradead.org ([205.233.59.134]:44504 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726235AbeJMV2X (ORCPT ); Sat, 13 Oct 2018 17:28:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=+XMwMXMjq9ROKzgzKBhLcRtyHTBtbPVhm0+mGC7F25k=; b=tTG4y1qZX3e+AOTlwqIM8VsFl ZI6NsUSboNcK+vog+UQlgu4r+p3qXD7ZB/+V5aDBJJ1+TCHtkmk2Zww1Pr8BQDov1l8GnT43Mdpsd xCYX8w5r8aqxU9jtDrYjpUhFq3UaAYPALjak0KUhEx0W0217S41zDGMzo+5YOQuE7BTkR81ML8HwW 9P+a0rPZVNBGE/LWtjFtuTgr9DcN8XC+tn0olrnVzf+7eYcJ+OdUpTpx0bCn9RkHQ2KLrKChlDE/g 3rus+31DMMwUUW83k9bctO6ePdmebIZt6RN+tqOoZ5TOm7KParB7U2a9PUYreaPWo08zgTXLh7Uuk 4aGz1Pctg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gBKJq-0005zA-9P; Sat, 13 Oct 2018 13:51:02 +0000 Received: by worktop (Postfix, from userid 1000) id C07B16E079E; Sat, 13 Oct 2018 15:50:58 +0200 (CEST) Date: Sat, 13 Oct 2018 15:50:58 +0200 From: Peter Zijlstra To: Andrew Morton Cc: Sebastian Andrzej Siewior , Dmitry Vyukov , Clark Williams , Alexander Potapenko , kasan-dev , Linux-MM , LKML , linux-rt-users@vger.kernel.org, Thomas Gleixner Subject: Re: [PATCH] mm/kasan: make quarantine_lock a raw_spinlock_t Message-ID: <20181013135058.GC4931@worktop.programming.kicks-ass.net> References: <20181005163320.zkacovxvlih6blpp@linutronix.de> <20181009142742.ikh7xv2dn5skjjbe@linutronix.de> <20181010092929.a5gd3fkkw6swco4c@linutronix.de> <20181010095343.6qxved3owi6yokoa@linutronix.de> <20181010214945.5owshc3mlrh74z4b@linutronix.de> <20181012165655.f067886428a394dc7fbae7af@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181012165655.f067886428a394dc7fbae7af@linux-foundation.org> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 12, 2018 at 04:56:55PM -0700, Andrew Morton wrote: > There are several reasons for using raw_*, so an explanatory comment at > each site is called for. > > However it would be smarter to stop "using raw_* for several reasons". > Instead, create a differently named variant for each such reason. ie, do > > /* > * Nice comment goes here. It explains all the possible reasons why -rt > * might use a raw_spin_lock when a spin_lock could otherwise be used. > */ > #define raw_spin_lock_for_rt raw_spinlock > > Then use raw_spin_lock_for_rt() at all such sites. The whole raw_spinlock_t is for RT, no other reason. It is the one true spinlock. From this, it naturally follows that: - nesting order: raw_spinlock_t < spinlock_t < mutex_t - raw_spinlock_t sections must be bounded The patch under discussion is the result of the nesting order rule; and is allowed to violate the second rule, by virtue of it being debug code. There are no other reasons; and I'm somewhat confused by what you propose.