Received: by 10.223.176.5 with SMTP id f5csp487367wra; Tue, 6 Feb 2018 02:21:41 -0800 (PST) X-Google-Smtp-Source: AH8x2250YjT1ZBLwWP8QageZvzPFw8tZ6YXc4v834I5EN+7vVF6Twmneyb4Sk4WsHGHEmRIz7ZOm X-Received: by 2002:a17:902:598e:: with SMTP id p14-v6mr1904678pli.439.1517912501124; Tue, 06 Feb 2018 02:21:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517912501; cv=none; d=google.com; s=arc-20160816; b=bz63n1s9WMSW+ySJVN2NgEBZR1xC6CtA6w/wFUSDJ57jGQMk/Kpk98DDxGeVlo81kk OaktvUdPp0QpgFCAHrGh3by3fBfo6KIo7SNngaWX2J3lo0AkLmhf5pC5MdKqyvguFHzj zpFcaf+T7vsc67yc4BfVOgqcBHBwKKtmqGEWgThWMOmERJkxx2IC3jbsajyhi5QNVXzZ iezTxSFMEfTde+sIYf24u8V1bqFkJES/onMDLKjfJJr4IAHCSz5KNCPaqRgRIGZy94SP +4wdPGOV1Q5RAI7Sg1s37nic7xL90n94zyyoriIq5XQNiD5YczN5xCxIChtmY0Wx6TbB HHQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:mime-version :user-agent:message-id:date:to:from:subject:dkim-signature :arc-authentication-results; bh=IgyJmxl5LOKemZjnZyV/XVaEU5WhpKCVN1oAh+HxE6M=; b=sxhECPfnhT0qpy+gkfrcHJz3PTd5qyhjStd8ctJ+eP8f0ZbepUGwXjzno1h+uXipTe 4BulS7HEAlR4h5MtnBUBmAJpn++7n7bR++9j7bJlH25bB7StT6q34PatfbWE0bdRuP2U ECgop1pPoW+JVFL2Xp9dkGIrfKZvgO4iBhJTvZ6hCS91s4lCZBtijDzOGwJFFYnHNGxH vZowL77b62594/85RoYqpKa4kF9EGgIaX9syR6TAz9QxQFrrRbQGkLwTc4M7lfTEqwNs HPWSPR18j5Zblrx7bfHl0fDW5OlMcwDO1Bm+Q7Yjr+GWHp96f+qFHV2XNNaXtEwHg+jL tqkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=IIEtYkqD; 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=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k91-v6si1097719pld.129.2018.02.06.02.21.27; Tue, 06 Feb 2018 02:21:41 -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=pass header.i=@virtuozzo.com header.s=selector1 header.b=IIEtYkqD; 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=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752649AbeBFKTx (ORCPT + 99 others); Tue, 6 Feb 2018 05:19:53 -0500 Received: from mail-he1eur01on0136.outbound.protection.outlook.com ([104.47.0.136]:26688 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752356AbeBFKTp (ORCPT ); Tue, 6 Feb 2018 05:19:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=IgyJmxl5LOKemZjnZyV/XVaEU5WhpKCVN1oAh+HxE6M=; b=IIEtYkqDKpbVCvMvJmTEeIVetygXk1uHJb3IgHtWpzLx/jzOYX1MPt+9IZnS/QT+E7CWp3aQEbp5rrnCfxwTYjuiHtjeNlyHRmg0BzKW57ZR5mWaFH1jXcB/iRwBqQgyGCO7lYgEksLBSTuLqLKdjMO2uBk/Wz9sx9KPvqzfxvc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from localhost.localdomain (195.214.232.6) by AM5PR0801MB1331.eurprd08.prod.outlook.com (2603:10a6:203:1f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.464.11; Tue, 6 Feb 2018 10:19:33 +0000 Subject: [PATCH 0/2] rcu: Transform kfree_rcu() into kvfree_rcu() From: Kirill Tkhai To: paulmck@linux.vnet.ibm.com, 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, ktkhai@virtuozzo.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Date: Tue, 06 Feb 2018 13:19:29 +0300 Message-ID: <151791170164.5994.8253310844733420079.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HE1P190CA0031.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::20) To AM5PR0801MB1331.eurprd08.prod.outlook.com (2603:10a6:203:1f::9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 12138cbb-4122-4ab2-ea3e-08d56d4b1e76 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020);SRVR:AM5PR0801MB1331; X-Microsoft-Exchange-Diagnostics: 1;AM5PR0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9cJaIuAm4rvEZYjV9B+YBLea0c5XmueLRrXlj9QTQePaHZXbf8xtm4KMvn31rcEtz6v7RAXQnz3kZqx45RVTY3n0wGMbMmXHvMu8NduuInYVZ/NfLyRFkUl6IyGGlNF/bM222nmg/Dg6o4a2yJfqIt81yMGQVXDkdPMH20EQIt/M8yAMHHiOfOO7Qwe69/JFvdmk+rXWtmhSgq2LJHf0RNPFnvNWE0duyacHp0Vy1ce7i32pZSSl5U5TggPB6KZ/ull/lYICijkIC3hH/SVd8=;4:IGO3FECW2Ef3sr4Q4zr8eLwg23QDp6LalB7zy7qIOrJ0rf9SzXX6BchGPfeY1DW4Yir328L9QxEcLxrMSUuINTCQUn7CIvMKMszLs7LUSEf1xiTlCn4E0EgG6LGUAEeHWMdRNgu0/UlA7vo5emMsegxphgHiSY6JGmxCdRH1HhgLYs8cQlpg6oglMGNbN32EnKL5+wns4LUABqHSpN1U+eEFNfcef/kzVk/NS1UycVC/W0vdd+umKkQW+Xf+GKFQqEHo1H8inEpH/fdED/xTPg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040501)(2401047)(8121501046)(5005006)(3231101)(2400082)(944501161)(3002001)(10201501046)(93006095)(93001095)(6041288)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011);SRVR:AM5PR0801MB1331;BCL:0;PCL:0;RULEID:;SRVR:AM5PR0801MB1331; X-Forefront-PRVS: 0575F81B58 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(376002)(396003)(366004)(346002)(39840400004)(39380400002)(189003)(199004)(9686003)(8676002)(3846002)(58126008)(53936002)(59450400001)(33896004)(478600001)(103116003)(186003)(105586002)(55236004)(7416002)(6506007)(26005)(16526019)(386003)(6116002)(106356001)(55016002)(230700001)(61506002)(305945005)(316002)(68736007)(7736002)(86362001)(2486003)(7696005)(47776003)(81156014)(50466002)(23676004)(52116002)(8936002)(6666003)(81166006)(97736004)(39060400002)(5660300001)(25786009)(66066001)(83506002)(2906002)(921003)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:AM5PR0801MB1331;H:localhost.localdomain;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBTTVQUjA4MDFNQjEzMzE7MjM6SGN5QU16MmRPRklSeDh6NTRFeXFvSkhY?= =?utf-8?B?Y0djZjZKaTlyTmFWeGY3bkdnMWNYTU8xQWFONTVFbFJMNEQrN3h0MXM5RFBs?= =?utf-8?B?aElFZHNMK2dzYU9wVy9ka3B6ek1MTjlUNTV2eVZoemxYVHBDMGovbmxNdk5C?= =?utf-8?B?dEdvUnBPMHRNVHhIQldaOHdLcThJRWoxS2hYUDVQTitZWXVFOWVpVm5lT1lP?= =?utf-8?B?R2s2a1BZTzRBZGxIN1JGcGJpUzBQTGtoVEZXSkZHSVpDU0tLV2J4Q1FlWTJZ?= =?utf-8?B?RTJTWW1vSzdibDQ3MzIzM0lLZ1d6ZEhzenAwVXpTdVNTdDdlYjJqS0pFdDNS?= =?utf-8?B?QklVYWN2dGpiZHJXQmVMai9Lc2RGNGhSU3hack42bktkNkhYRTZnS2tlb0NF?= =?utf-8?B?SCszVmMvdkJQTGQzSm9FalUxenhZMGVQeW1tcDZUZXgxcXVZVExWb3E3WENU?= =?utf-8?B?WVlJdmF4aEFpdEViVWQvK2ozNThsOFplSDJzTFV5ZXFLVzZVV0NtOTk3YzND?= =?utf-8?B?dHJMOElmalZrL1QxT1dpbzZ6YVFUNkFoREduVEwvWllZcVBjTHJ1Z3FUcEwy?= =?utf-8?B?TUM0UTFaM0I2R0FrRW1UWXlvYzY0SE9jYkc0MTJTaDFpYVh1Zm1reXRUZXha?= =?utf-8?B?OHd3QXR6M1p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RZmKCw8krG5K2rK39XPsM11Ti7EW5rJqpd+jgeozUvEs51e3BJxDM SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;AM5PR0801MB1331;20:7LLKqUTXidsDVuOG6PAPNNFt8Jo0if37b/1cuts+5lY4aSOKcgjl2yMybKacUqEyZywh5PrOAi7mB3I8rMgnLTXhw21KkFEqMfcT0fN1Tc5SW7Z6fgu3qqEtSf5Y2YI84Vrv8mjOlC6FuWsThpS0yPPGdnhz58cNVHbZsaSJKkc= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2018 10:19:33.4502 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 12138cbb-4122-4ab2-ea3e-08d56d4b1e76 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1331 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(). --- 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