Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3338937ybc; Thu, 21 Nov 2019 06:59:11 -0800 (PST) X-Google-Smtp-Source: APXvYqz9ob4qz7dzVg6Cu7Rfzob6tcEUG4FtOYoqx5X2HXvNAiQvASjLm/MHfmPCbWBSDuf8prYn X-Received: by 2002:a17:906:c314:: with SMTP id s20mr14504731ejz.118.1574348351642; Thu, 21 Nov 2019 06:59:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574348351; cv=none; d=google.com; s=arc-20160816; b=zmx0tntYqAglKERpzrEMPA7SLmScIefYnUzKdcWbX1qBz44PrD6V+N6GTnABrawUmR eYZ8cgHNHYG+iKn+vvBXRfwFQTOszXyM7SdKTxjvpX0I8RlEo/nyJ/73Np0mAY+dC7IV P2/6I0H6TVaBU1xWbEalWp8KTbtQ3JNy3oSKQQGdAIc2C1UAayU/qkk8dtmt1GPWb674 XLX+TqwmLFco3fMxEiTS5PvqrkQunnY8+c72FyDrVilyrRBOau4vhSz8aShazVEkapF1 V62rm/n7bMonvz3uVe8/guuE7M5R8NzUWtq1ir9x1zfl/Lz2h38jCcpXLUldyoiRBKso psMg== 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:mail-followup-to :reply-to:message-id:subject:cc:to:from:date; bh=jPqK30IZRsdf5jo9FevO//fg9mUarDlV3GdC40my1bo=; b=AWFoVtmEqYKhHTX+1MpS9yrsrfDCNIpTW5bpnHDUhDVfyKuxv+6aDNm3U1N8PiEC0A aPtJyR64f1gZ7zx1EarMZVjrBXoxO+f9HDhNIhbHGLRC/kTzRPSRTL4Lj5G8kk8zov1x nWqhkLVFQzCDhtYOT1on9GT7jt9PUKhbPjym5leGhhkJObmj7NiuaaTG9raxZx1t2GZ7 dDROHMdrvlZtMxZYbRj/X6zOoBLT7Diyzx/ZzcPkNwiO0/vI+uMvN86GnwDwInFGlpy3 vt+SeVB2RYfGV3RFqQEPcL7zoO5ItSPuR1hmIK9a10EBHD7QQtw9MIPoDK+SH15O5Hom Bgaw== ARC-Authentication-Results: i=1; mx.google.com; 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 s23si2015406eju.55.2019.11.21.06.58.47; Thu, 21 Nov 2019 06:59:11 -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; 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 S1726638AbfKUOzf (ORCPT + 99 others); Thu, 21 Nov 2019 09:55:35 -0500 Received: from mx2.suse.de ([195.135.220.15]:36678 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726541AbfKUOzf (ORCPT ); Thu, 21 Nov 2019 09:55:35 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id BC7BEAD07; Thu, 21 Nov 2019 14:55:33 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id E56F6DAAD7; Thu, 21 Nov 2019 15:55:33 +0100 (CET) Date: Thu, 21 Nov 2019 15:55:33 +0100 From: David Sterba To: Will Deacon Cc: linux-kernel@vger.kernel.org, Kees Cook , Ingo Molnar , Elena Reshetova , Peter Zijlstra , Ard Biesheuvel , Hanjun Guo Subject: Re: [RESEND PATCH v4 03/10] lib/refcount: Remove unused refcount_*_checked() variants Message-ID: <20191121145533.GZ3001@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Will Deacon , linux-kernel@vger.kernel.org, Kees Cook , Ingo Molnar , Elena Reshetova , Peter Zijlstra , Ard Biesheuvel , Hanjun Guo References: <20191121115902.2551-1-will@kernel.org> <20191121115902.2551-4-will@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191121115902.2551-4-will@kernel.org> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 21, 2019 at 11:58:55AM +0000, Will Deacon wrote: > The full-fat refcount implementation is exposed via a set of functions > suffixed with "_checked()", the idea being that code can choose to use > the more expensive, yet more secure implementation on a case-by-case > basis. > > In reality, this hasn't happened, so with a grand total of zero users, > let's remove the checked variants for now by simply dropping the suffix > and predicating the out-of-line functions on CONFIG_REFCOUNT_FULL=y. I am still interested in the _checked versions and have a WIP patch that adds that to btrfs (that was my original plan) but haven't had enough time to finalize it. The patch itself is simple, the missing part is to understand and document what the saturated counters would do with the structures. If the _checked helpers are really bothering for you, then well remove it, but I think it's a good API extension that makes the full-refcount semantics independent of the config.