Received: by 10.223.185.116 with SMTP id b49csp31121wrg; Thu, 22 Feb 2018 15:56:59 -0800 (PST) X-Google-Smtp-Source: AH8x224aSi80bMCMBxunXO4a5yWoyIm7hpH+xzuTeWEGl6RLRXFDIlvWcO8JP+jdh7YBjcobJgmD X-Received: by 2002:a17:902:68cc:: with SMTP id x12-v6mr1058861plm.198.1519343819797; Thu, 22 Feb 2018 15:56:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519343819; cv=none; d=google.com; s=arc-20160816; b=gRSYPmRSMZ1wjseWW2fBZCu03bOfknujHjlQkaczkd6ZsD19/Efak6L34xjg5kTYEu Sc3MiVvQ9my545urTZFl4BY+53LU9aljmgp9zUuw4xTFiJp1eHjVfRY+CQjOUEi4Bc1z QG3sDfImVixWjnmmzGGHJOo9XzNZr338Dtksm+qamyWnYk0e2DEvvW2sw1e22rlan948 jW2fq1yxWFWXUJVkPMxagn9Wge1+jag+LemtbPeoCUhQ4lKnwUVp3nl3BE5xMMnQy41G 2j7C9+uzZuXxo9uaF+KKBeyGiZ/+3HrEh7JfgYgVqu4Q+sJzYnGty0YzuAWc9e0opfoi 9FfA== 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=Von87r25cqtE+5i77ptAHvOnSgLxq6PNLYD5MsBqauE=; b=WJ0sGxRihbJ9V+uXtiwbrrnTsGLRCYIAJNOVrvnbAk4Sg8IP+e9GGyj+cv7wutSpoM zr+V4NuJeFevbxGLMUMcmkQQspnw8V+5nuu7Fa28dfHAcfNLfXe4eYqDr/YbGfaA2e5D jvJvdxHjE9vYgQfEV4Iq0/etLmSpUU5aAXIhPUL8fPmuvMDGkOewRtfadp3j0n019IDl Ef2TXX6QHF/fca/ONTIh920rN5flilaSuSwzXltZshZNE4QvBvtIT1LFubYCoFeVf1aT REfi1XEuzOsuzLRliT6ZDrzOqBrlpXVDa14MJh6VwLUV5rpmvhh418q9jPn/tPt/X4tC QPvg== 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 q128si659958pga.833.2018.02.22.15.56.45; Thu, 22 Feb 2018 15:56:59 -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 S1751888AbeBVXzQ (ORCPT + 99 others); Thu, 22 Feb 2018 18:55:16 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:48840 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751283AbeBVXzP (ORCPT ); Thu, 22 Feb 2018 18:55:15 -0500 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w1MNiX3w099107 for ; Thu, 22 Feb 2018 18:55:14 -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 2ga25yvbk8-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 22 Feb 2018 18:55:13 -0500 Received: from localhost by e19.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 22 Feb 2018 18:55:13 -0500 Received: from b01cxnp23032.gho.pok.ibm.com (9.57.198.27) by e19.ny.us.ibm.com (146.89.104.206) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 22 Feb 2018 18:55:08 -0500 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w1MNt8gT41943148; Thu, 22 Feb 2018 23:55:08 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DE8B2B2052; Thu, 22 Feb 2018 19:57:25 -0500 (EST) Received: from paulmck-ThinkPad-W541 (unknown [9.85.154.79]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id A1C18B2058; Thu, 22 Feb 2018 19:57:25 -0500 (EST) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id F389216C86CD; Thu, 22 Feb 2018 15:55:32 -0800 (PST) Date: Thu, 22 Feb 2018 15:55:32 -0800 From: "Paul E. McKenney" To: Matthew Wilcox Cc: Jesper Dangaard Brouer , Steven Rostedt , Kirill Tkhai , 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, 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> <20180207021703.GC3617@linux.vnet.ibm.com> <20180207042334.GA16175@bombadil.infradead.org> <20180207050200.GH3617@linux.vnet.ibm.com> <20180207083104.GK3617@linux.vnet.ibm.com> <20180207085700.393f90d0@gandalf.local.home> <20180207174513.5cc9b503@redhat.com> <20180207181055.GB12446@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180207181055.GB12446@bombadil.infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18022223-0056-0000-0000-00000422A8CB X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008579; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000254; SDB=6.00993655; UDB=6.00504921; IPR=6.00772995; MB=3.00019696; MTD=3.00000008; XFM=3.00000015; UTC=2018-02-22 23:55:12 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18022223-0057-0000-0000-00000864AF76 Message-Id: <20180222235532.GA11181@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-02-22_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 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-1802220296 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 07, 2018 at 10:10:55AM -0800, Matthew Wilcox wrote: > On Wed, Feb 07, 2018 at 05:45:13PM +0100, Jesper Dangaard Brouer wrote: > > On Wed, 7 Feb 2018 08:57:00 -0500 > > Steven Rostedt wrote: > > > To me kvfree() is a special case and should not be used by RCU as a > > > generic function. That would make RCU and MM much more coupled than > > > necessary. > > > > For the record, I fully agree with Steve here. > > > > And being a performance "fanatic" I don't like to have the extra branch > > (and compares) in the free code path... but it's a MM-decision (and > > sometimes you should not listen to "fanatics" ;-)) > > While free_rcu() is not withut its performance requirements, I think it's > currently dominated by cache misses and not by branches. By the time RCU > gets to run callbacks, memory is certainly L1/L2 cache-cold and probably > L3 cache-cold. Also calling the callback functions is utterly impossible > for the branch predictor. This seems to have fallen by the wayside. To get things going again, I suggest starting out by simply replacing the kfree() in __rcu_reclaim() with kvfree(). If desired, a kvfree_rcu() can also be defined as a synonym for kfree_rcu(). This gets us a very simple and small patch which provides the ability to dispose of kvmalloc() memory after a grace period. Thanx, Paul