Received: by 10.223.176.5 with SMTP id f5csp816507wra; Tue, 6 Feb 2018 07:52:01 -0800 (PST) X-Google-Smtp-Source: AH8x225y0VBK6ueT7iUrib3wquwSlMSCa84oVcWr8V+cx08c4dwbpIPDRcefde6dY8V2W0DvzoZg X-Received: by 2002:a17:902:14b:: with SMTP id 69-v6mr2858679plb.209.1517932320901; Tue, 06 Feb 2018 07:52:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517932320; cv=none; d=google.com; s=arc-20160816; b=Bj0sWtRrwgQff5oe8zW+lIj/YVK4H20fdq0Js5TgCyrOgV2LDNXYtvu1IQa9EimbVc Rv+ymVfiaX+WoUtUbTu5gC4wD8h+qz1zJvDib0BqJ9EfIXkRM3lqJ0TSDxHJzU1Wk64c RqAp4qmG2Mjg6Iel3vAA2ShLdFkYeehNlKM7kQz+y+wxzDdnLjPuBFvIRa6EgJA8Xr9t dCWLL/QPZ1FnkPPVforcgTMbmHGUzAjh80YFWZf77SAy09ibUuqa2K3rO/w8ZM/gPevj nmUt06IWOW+q2Biu5ZzK7gh8FKYWi/KznQIMDLwf9c347AEbYGArcS6/gk0mPlrDNAJC CIrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dmarc-filter:arc-authentication-results; bh=nIz52QLrrXK5prmY1nnYHb8YNe6p1NqOGaubl+luoYs=; b=p7smYDNBYAVSdThojUW/HcLw9MJFganAx+KR+B5wUWy3OolgSasL1LA0ZfhWRGEver 6iK1RpyjA1lIVUi6+dS9pD9efETFjQNGU5i0jUhR2ds0fxXw1awhyK8TnV+Oh0fie4Wk pQopu6NFwrB7r/2njcmA11XO3ixWT45hIN7+hYCfiqMLb/ATgLUgajcPkMUio4MyYyz6 XjiAPvfcrfUUKFQ2X6KBd+XttRc3Nz6NCR1IcJlJJ8soMUCGg+2nsNvtSH6YaG3ZjDd+ LhHOrDDew0gfEeH8c+VXeyJ5KCwOL+xsM023vrJPEI1KWm/02EyMtNOwoskDjIPfzsUf O4qg== 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 m66si1318398pfb.108.2018.02.06.07.51.44; Tue, 06 Feb 2018 07:52:00 -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 S1752366AbeBFPt3 (ORCPT + 99 others); Tue, 6 Feb 2018 10:49:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:54620 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751424AbeBFPtW (ORCPT ); Tue, 6 Feb 2018 10:49:22 -0500 Received: from gandalf.local.home (cpe-172-100-180-131.stny.res.rr.com [172.100.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E8B2E21748; Tue, 6 Feb 2018 15:49:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E8B2E21748 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Tue, 6 Feb 2018 10:49:19 -0500 From: Steven Rostedt To: Kirill Tkhai Cc: paulmck@linux.vnet.ibm.com, josh@joshtriplett.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 Subject: Re: [PATCH 1/2] rcu: Transform kfree_rcu() into kvfree_rcu() Message-ID: <20180206104919.0bc1734d@gandalf.local.home> In-Reply-To: <52fe3917-cf72-d512-8422-d53bacf40113@virtuozzo.com> References: <151791170164.5994.8253310844733420079.stgit@localhost.localdomain> <151791238553.5994.4933976056810745303.stgit@localhost.localdomain> <20180206093451.0de5ceeb@gandalf.local.home> <52fe3917-cf72-d512-8422-d53bacf40113@virtuozzo.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 6 Feb 2018 18:06:33 +0300 Kirill Tkhai wrote: > There are kfree_rcu() and vfree_rcu() defined below, and they will give > compilation error if someone tries to implement one more primitive with > the same name. Ah, I misread the patch. I was thinking you were simply replacing kfree_rcu() with kvfree_rcu(), but now see the macros added below it. > > We may add a comment, but I'm not sure it will be good if people will use > unpaired brackets like: > > obj = kmalloc(..) > kvfree_rcu(obj,..) > > after they read such a commentary that it works for both vmalloc and kmalloc. > After this unpaired behavior distribute over the kernel, we won't be able > to implement some debug on top of this defines (I'm not sure it will be really > need in the future, but anyway). > > Though, we may add a comment forcing use of paired bracket. Something like: > > /** > * kvfree_rcu() - kvfree an object after a grace period. > This is a primitive for objects allocated via kvmalloc*() family primitives. > Do not use it to free kmalloc() and vmalloc() allocated objects, use kfree_rcu() > and vfree_rcu() wrappers instead. > > How are you about this? Never mind, I missed the adding of kfree_rcu() at the bottom, and was thinking that we were just using kvfree_rcu() for everything. That's what I get for looking at patches before my first cup of coffee ;-) If you want to add a comment, feel free, but taking a second look, I don't feel it is necessary. -- Steve