Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp12024800ybl; Sat, 28 Dec 2019 03:51:28 -0800 (PST) X-Google-Smtp-Source: APXvYqwSPT071aUaWVe8RGI+LDA+V/Q8bcpFk0/82Et02yJ6eZp6SGUTavfs9d+StN2nOyK8gxH2 X-Received: by 2002:a05:6830:1e09:: with SMTP id s9mr45020283otr.139.1577533887959; Sat, 28 Dec 2019 03:51:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577533887; cv=none; d=google.com; s=arc-20160816; b=hS6DMCE47yJlBnttS7+Y2YoP/fXKiFgY2Z0V7efC2ftnGRCAWpRvty3isaJNFZIN5r JM8d08Y7u/mmRWmcfsWHVnh0oddBN+5UBqGOMzPMX/3SNRk4T4ByleEk3JxrgjbOJ6DY eSTIP8ZTQ4lx7WAosyPtX7cBK/9NwAJuuhWl+sxBsx3Ngog8U6XdIeyIqm9NLyjP0dBB dyCBQKV4xRDB8NvQD4cWj3iIZujy1Y792zTZ6NYSzkcRQbK9TMabjtUbGZ9uTrIAVDK+ cr40ax7O6IqaI5BR1rprYzJh3xCSWv9mad8mjdUemKldBWan4z25JPui/0vlX+b4y5Z7 XiGA== 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=B4N/Pajva8FCKvPVBeM24EtxvHj9mSBvKt6CCr/F2kw=; b=r1uW1YMaACo7wH+TK/bfLAQ8EOylZlGHxjjjTiDQi4ROOXPcyAJizRyVanfjsY2+4u CW6Z72uZbKIYjQVgJQ2zrKJ9m92BRtLLqCxMBF9o5wmU1S/1k4WvTpH+cIZmK6uhs2WO dAW1jv5IFHkIwgal2YTPU3n6FzsHOlnCLGKYm9tGn7LUU8yYXJkHP2wwVm44W/XscbAC /mxw51IJlLaH16Q5b9O2cjxt3RVNyEjDVl+j2lPjZuNxDOPW4FRvFKdmrBUNo1P3en4j A+1KJjgJ2ZK4vgbo9/NAUCz9nW24MzCZj8OW1nmuPbITzzW/eNlYhZhk7xYxIMpZDLI7 0JRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=cStUo1AA; 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 v124si12360870oib.173.2019.12.28.03.51.10; Sat, 28 Dec 2019 03:51:27 -0800 (PST) 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=bombadil.20170209 header.b=cStUo1AA; 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 S1726391AbfL1Ltt (ORCPT + 99 others); Sat, 28 Dec 2019 06:49:49 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:55126 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726071AbfL1Ltt (ORCPT ); Sat, 28 Dec 2019 06:49:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=B4N/Pajva8FCKvPVBeM24EtxvHj9mSBvKt6CCr/F2kw=; b=cStUo1AA8SqM/4+GW8ld0Q5qs huukWX6L+uFdR9NUBkY+krZtF901qmo9uaV2p0t8wTSnE+O+BD+6zBfASRFY2vq/ILfOsn2G9b/ij kkO+2T8TxouMBgM8CO+md57BAa0h2krLClG/+qnfQ0NChbBw79nquEHqQepzYsZ7ddp1KJo4CEwn1 PYeFGZfv3LGnqbONyEIIx/KkabVMnStGxB12XqVZPQdRSuWtl08GhLkkG+YIq327OKIW3lYZry2MQ GBqCoRVTzOUCqj790ppUn0xb8Xmxm2ig4q1I8YCBt90hIf6Je96hOapooJ7d8gMLP0quwZbkJqMsU Rw2oTlJ2A==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1ilAav-0003Lw-Og; Sat, 28 Dec 2019 11:49:21 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 1B122300596; Sat, 28 Dec 2019 12:47:50 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id B495A20E07103; Sat, 28 Dec 2019 12:49:18 +0100 (CET) Date: Sat, 28 Dec 2019 12:49:18 +0100 From: Peter Zijlstra To: Eric Biggers Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Will Deacon , Elena Reshetova , Thomas Gleixner , Kees Cook , Anna-Maria Gleixner , Sebastian Andrzej Siewior Subject: Re: [PATCH] locking/refcount: add sparse annotations to dec-and-lock functions Message-ID: <20191228114918.GU2827@hirez.programming.kicks-ass.net> References: <20191226152922.2034-1-ebiggers@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191226152922.2034-1-ebiggers@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 26, 2019 at 09:29:22AM -0600, Eric Biggers wrote: > From: Eric Biggers > > Wrap refcount_dec_and_lock() and refcount_dec_and_lock_irqsave() with > macros using __cond_lock() so that 'sparse' doesn't report warnings > about unbalanced locking when using them. > > This is the same thing that's done for their atomic_t equivalents. > > Don't annotate refcount_dec_and_mutex_lock(), because mutexes don't > currently have sparse annotations. I so f'ing hate that __cond_lock() crap. Previously I've suggested fixing sparse instead of making such an atrocious trainwreck of the code.