Received: by 10.223.176.5 with SMTP id f5csp346990wra; Tue, 6 Feb 2018 23:55:42 -0800 (PST) X-Google-Smtp-Source: AH8x227ykkrO/NW8SGQLxNKvfNLDpsVqujcxabjuDGP5tDK/9c/4QdJ77G0A+8JevzeJFSmdyhwA X-Received: by 2002:a17:902:8f86:: with SMTP id z6-v6mr5138437plo.352.1517990142848; Tue, 06 Feb 2018 23:55:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517990142; cv=none; d=google.com; s=arc-20160816; b=ChLx9OSplssNgD8eILBIpviOccjWDY8QbN2P86lHmQQqrE16/tSopCkvdJo4YfJtmu bgN1vr4jG6kS0Gb7iRX5XxbF/3RehZCK5ehFodzGgdnOy++GA3YqpUdixglfJbSf9toE yw5Q5R1w3OzDwW+LZsfBXU36RD9g6u9cFe0b5Mb1lnT7xvL6MZiK0fy/p4cz+Zp0cZhh wb9Em56oWfCMM0OXqWB2vmdCwCXTUi5kdmglmpAQBhblb7AKB3PA5TZsrXwUP56/qEnF 5V5ZorBBJvWBJvVXnK6vnEMXs2Ze4swxLotuCBlRelGX8WBbol+HvkYl+c2cEobsNFaP R+6g== 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=3l/JecwfxGd6U6EElpq1vnNN1urJqO+RK+7zifAMv5s=; b=tD3KOXyVrlMqpBodGpPdbdwp2Li1Jm3Z8e+1ejqSL5dDWCKL/71BTUaBPnV9z1tt7f JNoTAGvEUsy0t1PuAkQrGVGzbxJ7reBL0H1B+N/yfqtvoioiUkSlcyorJ19IgSCZPaUC ITQtjw+i9rGi0xSOJQSgMgoQuROUpCoosRQVVesripUCd3Xgkb7OsdiIo2dWjjcxXsBE hPOjKgYjvTquKm4FgquVau8EUHz7QZHUlRwu9kGl2mAeihhCZHi3fLSNtVn74C2sG6eE Ee8W2b7/eag6+feQuxpKq2+5oz2EHyih9i4k1lpPNAoFRLZg5wzsbdxIDPZnUcA3VjpX IQ1Q== 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 g30si612624pgn.394.2018.02.06.23.55.18; Tue, 06 Feb 2018 23:55:42 -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 S1753337AbeBGHyV (ORCPT + 99 others); Wed, 7 Feb 2018 02:54:21 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:49661 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750815AbeBGHyU (ORCPT ); Wed, 7 Feb 2018 02:54:20 -0500 X-Originating-IP: 50.39.166.153 Received: from localhost (50-39-166-153.bvtn.or.frontiernet.net [50.39.166.153]) (Authenticated sender: josh@joshtriplett.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 28AA4A80E6; Wed, 7 Feb 2018 08:54:10 +0100 (CET) Date: Tue, 6 Feb 2018 23:54:09 -0800 From: Josh Triplett To: "Paul E. McKenney" Cc: Matthew Wilcox , Kirill Tkhai , rostedt@goodmis.org, mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com, mingo@redhat.com, cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, brouer@redhat.com, rao.shoaib@oracle.com Subject: Re: [PATCH 0/2] rcu: Transform kfree_rcu() into kvfree_rcu() Message-ID: <20180207075409.GA5726@localhost> References: <151791170164.5994.8253310844733420079.stgit@localhost.localdomain> <20180207021703.GC3617@linux.vnet.ibm.com> <20180207042334.GA16175@bombadil.infradead.org> <20180207050200.GH3617@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180207050200.GH3617@linux.vnet.ibm.com> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 06, 2018 at 09:02:00PM -0800, Paul E. McKenney wrote: > On Tue, Feb 06, 2018 at 08:23:34PM -0800, Matthew Wilcox wrote: > > On Tue, Feb 06, 2018 at 06:17:03PM -0800, Paul E. McKenney wrote: > > > So it is OK to kvmalloc() something and pass it to either kfree() or > > > kvfree(), and it had better be OK to kvmalloc() something and pass it > > > to kvfree(). > > > > > > Is it OK to kmalloc() something and pass it to kvfree()? > > > > Yes, it absolutely is. > > > > void kvfree(const void *addr) > > { > > if (is_vmalloc_addr(addr)) > > vfree(addr); > > else > > kfree(addr); > > } > > > > > If so, is it really useful to have two different names here, that is, > > > both kfree_rcu() and kvfree_rcu()? > > > > I think it's handy to have all three of kvfree_rcu(), kfree_rcu() and > > vfree_rcu() available in the API for the symmetry of calling kmalloc() > > / kfree_rcu(). > > > > Personally, I would like us to rename kvfree() to just free(), and have > > malloc(x) be an alias to kvmalloc(x, GFP_KERNEL), but I haven't won that > > fight yet. > > But why not just have the existing kfree_rcu() API cover both kmalloc() > and kvmalloc()? Perhaps I am not in the right forums, but I am not hearing > anyone arguing that the RCU API has too few members. ;-) I don't have any problem with having just `kvfree_rcu`, but having just `kfree_rcu` seems confusingly asymmetric. (Also, count me in favor of having just one "free" function, too.)