Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1615417imm; Thu, 12 Jul 2018 05:09:16 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd7ekWQeT40DzCHEhruTQSQG3L4RdbApQSjPwLNwzz9UBZquAo5sKJu3JAzzAXV+cYPRFP/ X-Received: by 2002:a63:c742:: with SMTP id v2-v6mr1858307pgg.331.1531397356597; Thu, 12 Jul 2018 05:09:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531397356; cv=none; d=google.com; s=arc-20160816; b=0nx/4T0gPyh7NLx1c05BCVkky7seGgFAJQ9LsHaVSabOxWCBEz55IOgOz/9miCh6Hr cDED5LxKggZbV3gJP2D/ApN2P0mtG8shCb1bnp3Fl4ZXSE5GP7uuLRCAiZFjKwe6FwU1 lc65Cpzl/2Zsu/2a5OEn0hl8S7derTQNEqCQpCtcAkTcBKH7o1RdZpzOozZ41YgD4RdY xgOobbz6rhMslMw3FHrLapgDCj2J1EKZ3EZRaBtnIHdPYlMnESFKwvao52X1PzGGUL5b 0k1GQXe/j4lvDJUJx0DfN6OF8O8AM83zc9F3mvExF3p9DtZeRDeCIKV/VffT2nCi2ttu 9GWw== 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:arc-authentication-results; bh=nmzQ/lkyYOjRHASScd9zwpKgbvmunA76JMIQEQu2Rro=; b=uGWwpzDM7njK+V5nVU0ND5xNvgZtT1H3oBY0EczBKUC3e9voIqGtqUaryFEScA1NYy Q3diD7HXH7Vx4DF/iuaaecVMLBxpbCpDIQfNpDzmzHxzmiOzgwwZRQaNVV9Ks5GOVJN5 X74u3TQIBbc4Kqb6XDzyVPKQTLOl6kz2gwGvPviv3Etltpln9sxVNkPCStgnDzNOf26f O48dvyGPQKPKCzGdzbc0IUfHZ3n7mRvZEr/CwRJ8BD6BazflP9TCv159QeE5LbTR0kGF 0n3hr2og6yrCcJi0oi3n0BUox21YdxiksZpA2hv8Mdlosgd4MEg1A8uy/gSyvoSlABmw XWCw== 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 a14-v6si23782174plt.382.2018.07.12.05.09.00; Thu, 12 Jul 2018 05:09:16 -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; 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 S1726812AbeGLMRm (ORCPT + 99 others); Thu, 12 Jul 2018 08:17:42 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:50290 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726650AbeGLMRl (ORCPT ); Thu, 12 Jul 2018 08:17:41 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 531FDED1; Thu, 12 Jul 2018 05:08:25 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F2BD83F5B1; Thu, 12 Jul 2018 05:08:23 -0700 (PDT) Date: Thu, 12 Jul 2018 13:08:21 +0100 From: Mark Rutland To: dsterba@suse.cz, Kees Cook Cc: linux-kernel@vger.kernel.org, Will Deacon , Boqun Feng , Peter Zijlstra , Ingo Molnar Subject: Re: [PATCH] refcount: always allow checked forms Message-ID: <20180712120821.3qw3erubpok5csd7@lakrids.cambridge.arm.com> References: <20180703100102.16615-1-mark.rutland@arm.com> <20180704084641.GL3126@suse.cz> <20180711054946.wdkfoou6kt2a2vml@salmiak> <20180711173705.j6qfye4rq3ccmdyq@twin.jikos.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180711173705.j6qfye4rq3ccmdyq@twin.jikos.cz> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 11, 2018 at 07:37:05PM +0200, David Sterba wrote: > On Wed, Jul 11, 2018 at 06:49:46AM +0100, Mark Rutland wrote: > > > > Dave pointed out that it would be useful to be able to opt-in to full checks > > > > regardless of CONFIG_REFCOUNT_FULL, so that we can simplify callsites where we > > > > always want checks. I've spotted a few of these in code which is still awaiting > > > > conversion. > > > > > > The motivation was code like > > > > > > WARN_ON(refcount_read(&ref)); > > > if (refcount_dec_and_test(&ref)) { ... } > > > > > > so the warning is redundant for REFCOUNT_FULL, but I'm going to use the > > > _checked versions everywhere the performance of refcounts is not > > > critical. > > > > If you will have conversion patches, do you want to pick this up as the start > > of a series? > > The patches where I'd use the enhanced refcounts are nice-to-have and I > don't have an ETA so it would be better if the patch gets merged > independently. Thanks. Ok. Kees, I will leave this to you. Mark.