Received: by 10.223.176.5 with SMTP id f5csp110614wra; Tue, 6 Feb 2018 18:18:54 -0800 (PST) X-Google-Smtp-Source: AH8x225E0qRyOwghG6suvi+X0NffeIdnfeV+aXxLyHufnfswfUugePJxfORzw79+iAh7MuNZcc6K X-Received: by 10.101.80.69 with SMTP id k5mr3526050pgo.443.1517969934809; Tue, 06 Feb 2018 18:18:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517969934; cv=none; d=google.com; s=arc-20160816; b=wnn3biTIzWu6Tmgrb2d3Bcr0BgHTbGGCJGPabI+FjXZ82iOhHH1EmHUL7bWIjdsZv0 j+vIeARKy1TJEA7IzzS+YeYWeEJqNw7X829ezuW4GBhEimABorbpaYaoIxb+rjMoyT3D 84ZQEH1vWsd8haz5GTdrpvrOl7/Ybkf9V0h40C/hXGLLyFHZ6+5aHAQjoS/MNcJrFKwT 53vYYds6tNsu6qnVrUGYCaFT4ckzp7AHnwwe9X22CfKrEw5h6jCThzX4osAp5KSw59P6 A/Y0BGSr7q/7VmWjBvoVrtuImYvVPZlx6WmfVXSA9EIQf+FocdD2I/uTEKGdxNNV0QUm B2lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:subject:cc:to :from:date:arc-authentication-results; bh=dBGX2MTZjbyGmSjlpL+qfhUTL4JWR+nwPlhTDAuZ6yg=; b=rr0Jex5G6xU6t+Uz4BxlRg1aMFUUaL+PQ/C+9te8lgknx+JzTjPoG0VglhgOsixMxK H/Lzh90O9yO21PJZiUh+LygW7b0r48q2M+3PqVV8gSHSKfdR+aHAbapMvQ0kvVkWjoF+ PCpOEs+UvdOG4KUobFpY9Oa16v6lPcr7iCjc8fEIyCJymbxwJhQJ5HxceGLZIC0axZmL enjOu2vro9SrcNSnrVxsScbN8ycr4Iuu2sG8K0BEwJZayP+xQy3M/crUYwN5P5HLnyxx a17JsC+zWF8G4tqW7ZDWUBPmnLtTDeVqXLnihNDQl3Fisje/e4fWCHvVUMkAkS8QlU1s 8cuA== 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a72si324881pfj.343.2018.02.06.18.18.40; Tue, 06 Feb 2018 18:18:54 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753245AbeBGCRA (ORCPT + 99 others); Tue, 6 Feb 2018 21:17:00 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:46132 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752859AbeBGCQ7 (ORCPT ); Tue, 6 Feb 2018 21:16:59 -0500 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w172FqKe066317 for ; Tue, 6 Feb 2018 21:16:59 -0500 Received: from e19.ny.us.ibm.com (e19.ny.us.ibm.com [129.33.205.209]) by mx0a-001b2d01.pphosted.com with ESMTP id 2fyqhgj3wt-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 06 Feb 2018 21:16:58 -0500 Received: from localhost by e19.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 6 Feb 2018 21:16:57 -0500 Received: from b01cxnp22035.gho.pok.ibm.com (9.57.198.25) by e19.ny.us.ibm.com (146.89.104.206) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 6 Feb 2018 21:16:52 -0500 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w172Gqi150462838; Wed, 7 Feb 2018 02:16:52 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0D306B2046; Tue, 6 Feb 2018 21:13:48 -0500 (EST) Received: from paulmck-ThinkPad-W541 (unknown [9.124.35.70]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id C1799B204E; Tue, 6 Feb 2018 21:13:47 -0500 (EST) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id ABE5D16C6240; Tue, 6 Feb 2018 18:17:03 -0800 (PST) Date: Tue, 6 Feb 2018 18:17:03 -0800 From: "Paul E. McKenney" To: Kirill Tkhai Cc: 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() Reply-To: paulmck@linux.vnet.ibm.com References: <151791170164.5994.8253310844733420079.stgit@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <151791170164.5994.8253310844733420079.stgit@localhost.localdomain> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18020702-0056-0000-0000-00000416B8A7 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008488; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000248; SDB=6.00986026; UDB=6.00500366; IPR=6.00765393; BA=6.00005813; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00019412; XFM=3.00000015; UTC=2018-02-07 02:16:56 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18020702-0057-0000-0000-0000084E27CE Message-Id: <20180207021703.GC3617@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-02-07_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1802070022 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 01:19:29PM +0300, Kirill Tkhai wrote: > Recent times kvmalloc() begun widely be used in kernel. > Some of such memory allocations have to be freed after > rcu grace period, and this patchset introduces a generic > primitive for doing this. > > Actually, everything is made in [1/2]. Patch [2/2] is just > added to make new kvfree_rcu() have the first user. > > The patch [1/2] transforms kfree_rcu(), its sub definitions > and its sub functions into kvfree_rcu() form. The most > significant change is in __rcu_reclaim(), where kvfree() > is used instead of kfree(). Since kvfree() is able to > have a deal with memory allocated via kmalloc(), vmalloc() > and kvmalloc(); kfree_rcu() and vfree_rcu() may simply > be defined through this new kvfree_rcu(). Interesting. 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()? If so, is it really useful to have two different names here, that is, both kfree_rcu() and kvfree_rcu()? Also adding Jesper and Rao on CC for their awareness. Thanx, Paul > --- > > Kirill Tkhai (2): > rcu: Transform kfree_rcu() into kvfree_rcu() > mm: Use kvfree_rcu() in update_memcg_params() > > > include/linux/rcupdate.h | 31 +++++++++++++++++-------------- > include/linux/rcutiny.h | 4 ++-- > include/linux/rcutree.h | 2 +- > include/trace/events/rcu.h | 12 ++++++------ > kernel/rcu/rcu.h | 8 ++++---- > kernel/rcu/tree.c | 14 +++++++------- > kernel/rcu/tree_plugin.h | 10 +++++----- > mm/slab_common.c | 10 +--------- > 8 files changed, 43 insertions(+), 48 deletions(-) > > -- > Signed-off-by: Kirill Tkhai >