Received: by 10.223.176.5 with SMTP id f5csp197067wra; Tue, 6 Feb 2018 20:24:45 -0800 (PST) X-Google-Smtp-Source: AH8x226xyqt/e5gXbselhqLhphK37IfPKUKa6xfGVDo/qnzVehdfwRG3MufcwjieyGd2ChM4NuWz X-Received: by 10.101.83.3 with SMTP id m3mr3778093pgq.396.1517977485519; Tue, 06 Feb 2018 20:24:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517977485; cv=none; d=google.com; s=arc-20160816; b=aZ4euz6tfcxC1YPn1Teedh6RXHz/JUwA2X95E759e26P5I0cOHsc+kggasjkSRAufY FOEjthm36OWHLgcT3BO8peltlH05WMGxXQdnMAYNNBN4/QpXoDZ7RyN8S6ltuOKyvsmE 3sl4IWKi6H62aeD59dMuVcGiykn4u4iYgAV/isR1sH0Jf4ay7bzdrsmFarkFHAB1GvbW LVZ0gB7v0u9IGClM3PZnVlmglFt/WOCcy/FeBuXhfyngTS5OnIveC6gP29MHeGX8lKe2 LBeYtmMNDbgBOxSFcM/fvC8F9bayGYARzbkY6y7uwaKOU4pOIJDnz5YD24wvcI8hmeEz wUlw== 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:arc-authentication-results; bh=v71aA//MM6IvGerFZluO3271kBu4+MJTsyZiWgIWxeA=; b=KhgXLbdGiI5Y3sR9XmF+8aIzBGaqtnayxjLC37nEHT53K4b6eP90GYeSxb25FKHs1/ E5V2w6q1t7HQvgNQlmpO+GOhtvnSvOKI6Es62vADHtKPvOERHh5IGBaBiLqa0y+BR/mS yDSRiZ7Wsc8QHFITJzAFsl1KpgoGc9iPIqIt9NxjJVpWCwTgUTPCtmueXDvnNF5BxU/t sK/IKN3lpGDaFefKUXSwqxVDG/IJBDDdb51rmHdo8vG+1g4Smi4+AbHRxq0KCnQ9xNRc FD5WtnjBSfh3luWp0HQ6kRPlXEZpIlTBqaVpqSWTDudcTxDTWhmVRP52D9Zhfu8lZSKM It/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=QATj56AU; 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 3si490455pfi.416.2018.02.06.20.24.29; Tue, 06 Feb 2018 20:24:45 -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=QATj56AU; 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 S1752952AbeBGEXs (ORCPT + 99 others); Tue, 6 Feb 2018 23:23:48 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:59357 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752465AbeBGEXr (ORCPT ); Tue, 6 Feb 2018 23:23:47 -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=v71aA//MM6IvGerFZluO3271kBu4+MJTsyZiWgIWxeA=; b=QATj56AUmgQrdP/bRwOlNPGZR nm8Z/rAMVAx2KGE8KJNMTELpCZrUPRzSyEsy5Sov1cSVfIEGMiC9aG4yNWTYaHQ3BsNLm4dLvw+4W zdqf6zsx8b0c9Zie2jEcGYfgpEs5sIUSZoaLJAPXYXI/QZtSvFc3+RDmikeFd+zkAYeK86sdS39Bc 2PeD+t8IDZSzkacnAiqApVr/vW0PZhpErxEW16GVZlGrFUFTJ46U/z+oIP4azB3pWmZfUvPcHef4I O9DPxvwbVDBUXX0ATktnoZO8mq7lZ7p0fUmtwQ4FpK+r0bVV8JXvszCvSqq2a2Sxd6KFDQ1f+japr ucu5ialyg==; Received: from willy by bombadil.infradead.org with local (Exim 4.89 #1 (Red Hat Linux)) id 1ejHGg-0005t3-GV; Wed, 07 Feb 2018 04:23:34 +0000 Date: Tue, 6 Feb 2018 20:23:34 -0800 From: Matthew Wilcox To: "Paul E. McKenney" Cc: Kirill Tkhai , josh@joshtriplett.org, 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: <20180207042334.GA16175@bombadil.infradead.org> References: <151791170164.5994.8253310844733420079.stgit@localhost.localdomain> <20180207021703.GC3617@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180207021703.GC3617@linux.vnet.ibm.com> User-Agent: Mutt/1.9.1 (2017-09-22) 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 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.