Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp884406ybi; Fri, 31 May 2019 10:14:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqwiJKjrf7jKbxN8HDQlUHCAos4OGkEis2s4f+BHVEBmWvyU1/8ROdfteXvYAocTSGwWmYCE X-Received: by 2002:aa7:824b:: with SMTP id e11mr9565384pfn.33.1559322885468; Fri, 31 May 2019 10:14:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559322885; cv=none; d=google.com; s=arc-20160816; b=ALECbhYQzhWgGd/jL7wMvXzam0gz4PkerRDaBV5l+TDPMmGg/fgRUS0ijfeQDo/PbT 5dI/NZewDL2ihbvlsiQHTpHosHgrR+3qA4UuaJ1uN5tTkx6IFWNeTYuY8BXtD3LXaTpE xpZI1RLZ7rEvWN7Jfqym5wQsn41EGP8t8V01DsN3pnjp2k+348kdMKvo/IhdPcDnU7aJ iK8njKAVPoAR2v1/jl6vPwb3te4vqBOqGuE7Uqu0u5inDRSPVYcIAjmBmvz5YsDEkOj4 ijs1YcLWyWOAKL8J/IXFysI8LDl8M4JW3yJO/ogV9pdr0LCNV1q5CBABKC8ch6lDT4aB 480A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:content-id:mime-version :subject:cc:to:references:in-reply-to:from:organization; bh=NbU5F2YX8be/z7zWApwvMQ4F0+LFONuBRz0xGjvpylc=; b=sjoV2VZMhpMO7tm0S5JwdR2Dx9Wa+icU+e/LAxedO8TLcR/2coE+tzVFi5PywsxAkx 4xhia48wx8f1RTaU1LCTL+wKFO+EsEiA3qidUJ4bGiFK1/COZRlbDaD089yWbio+ogLR PeGmuQvYT3CJd7Zl/vHlEB+CWoVjD+p2khrmHkRXWgtYegXJmeMcjulZb0VURcRPCQ4Y 2gTcKSNsAU15zwvPKqau72nfInmDUDEwwoFGqKocltbmV0nJFq7v/Py1xepYG5fabxDp 8gRC4uKQWchC0G0uoXK2VwHCTfrh/PgJH6VsMXNV4N4XzTITtgca+ELVjziFFymvHOy6 pb+A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p7si7790676pfn.266.2019.05.31.10.14.29; Fri, 31 May 2019 10:14:45 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726990AbfEaRMw (ORCPT + 99 others); Fri, 31 May 2019 13:12:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37760 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726558AbfEaRMv (ORCPT ); Fri, 31 May 2019 13:12:51 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1C2FA85365; Fri, 31 May 2019 17:12:51 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-120-173.rdu2.redhat.com [10.10.120.173]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3B5C958CA2; Fri, 31 May 2019 17:12:48 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20190531164444.GD2606@hirez.programming.kicks-ass.net> References: <20190531164444.GD2606@hirez.programming.kicks-ass.net> <20190528162603.GA24097@kroah.com> <155905930702.7587.7100265859075976147.stgit@warthog.procyon.org.uk> <155905931502.7587.11705449537368497489.stgit@warthog.procyon.org.uk> <4031.1559064620@warthog.procyon.org.uk> <20190528231218.GA28384@kroah.com> <31936.1559146000@warthog.procyon.org.uk> <16193.1559163763@warthog.procyon.org.uk> <21942.1559304135@warthog.procyon.org.uk> <606.1559312412@warthog.procyon.org.uk> To: Peter Zijlstra Cc: dhowells@redhat.com, Jann Horn , Greg KH , Al Viro , raven@themaw.net, linux-fsdevel , Linux API , linux-block@vger.kernel.org, keyrings@vger.kernel.org, linux-security-module , kernel list , Kees Cook , Kernel Hardening Subject: Re: [PATCH 1/7] General notification queue with user mmap()'able ring buffer MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <15400.1559322762.1@warthog.procyon.org.uk> Date: Fri, 31 May 2019 18:12:42 +0100 Message-ID: <15401.1559322762@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 31 May 2019 17:12:51 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Peter Zijlstra wrote: > > > (and it has already been established that refcount_t doesn't work for > > > usage count scenarios) > > > > ? > > > > Does that mean struct kref doesn't either? > > Indeed, since kref is just a pointless wrapper around refcount_t it does > not either. > > The main distinction between a reference count and a usage count is that > 0 means different things. For a refcount 0 means dead. For a usage count > 0 is merely unused but valid. Ah - I consider the terms interchangeable. Take Documentation/filesystems/vfs.txt for instance: dget: open a new handle for an existing dentry (this just increments the usage count) dput: close a handle for a dentry (decrements the usage count). ... ... d_lookup: look up a dentry given its parent and path name component It looks up the child of that given name from the dcache hash table. If it is found, the reference count is incremented and the dentry is returned. The caller must use dput() to free the dentry when it finishes using it. Here we interchange the terms. Or https://www.kernel.org/doc/gorman/html/understand/understand013.html which seems to interchange the terms in reference to struct page. David