From patchwork Wed Nov 20 06:47:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ran Xiaokai X-Patchwork-Id: 13880750 Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.2]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E7CBB12E5B; Wed, 20 Nov 2024 06:48:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.31.2 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732085302; cv=none; b=jpSnZQqSLGD+FwZflfiScCfhfDLUngYCtQAkW2V6PMTJ3zEwHaUSdV3t0fax/hCqDf2/pR4pHvRGNYS9AazfnrH2gPBlp4I5yfruHxNyNAr0FF48GsDmNeKQPB5hlJnh94GFs8rjTfbwG6eREkqNGWX0+mS1eimEc4936rQlhwU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732085302; c=relaxed/simple; bh=toOq20qVXZzub2JqslpVXaa5G6T1/Fn2No54S89QEQE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=MzlKGsrYc7PATiC15fvfWeRPUkjNfqzXl9/OoLbxytcUOMpYeaZtFhQcB1rGzgCvr/T39gP9d1/eRkWM/o8U0bcmuonjQiPfY9n6vz/x/VTkHIVOhpHK+DWPCy927JOfnGxBEDU45N/F4gpARDNOPHTlnXAkAyow4d6/DEdAQYo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=ke954XUX; arc=none smtp.client-ip=220.197.31.2 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="ke954XUX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=bmhQu nCpSSNOOQvTNauj7axcKMoPEb4r9c+M61pUEm0=; b=ke954XUXCBwoIJY01ZbPP CVA1smL1UXQJ/yJEvewmr+lrRDIVJA6FXweFajAj8cmMIa683V8La64tisCgZS4m 7HI8FZCU16gaB+Hgg24YurKJ7SK0dafUSDNasqdnz8u+lmkuviamNY7/Zd7GXjTD TxKaT0ghXhyaLW/AFXvuSA= Received: from localhost.localdomain (unknown [193.203.214.57]) by gzga-smtp-mtada-g1-2 (Coremail) with SMTP id _____wDnD1j4hT1nTO3OIQ--.22522S5; Wed, 20 Nov 2024 14:47:24 +0800 (CST) From: Ran Xiaokai To: juri.lelli@redhat.com, vincent.guittot@linaro.org, mingo@redhat.com, peterz@infradead.org, pshelar@ovn.org, davem@davemloft.net Cc: linux-kernel@vger.kernel.org, ran.xiaokai@zte.com.cn, linux-perf-users@vger.kernel.org, netdev@vger.kernel.org, dev@openvswitch.org Subject: [PATCH 1/4] sched/topology: convert call_rcu(free_ctx) to kfree_rcu() Date: Wed, 20 Nov 2024 06:47:13 +0000 Message-Id: <20241120064716.3361211-2-ranxiaokai627@163.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241120064716.3361211-1-ranxiaokai627@163.com> References: <20241120064716.3361211-1-ranxiaokai627@163.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID: _____wDnD1j4hT1nTO3OIQ--.22522S5 X-Coremail-Antispam: 1Uf129KBjvJXoW7AF1fJFyDKFy7ZF1rtw1DZFb_yoW8XrW5pF WrGryUKw4vyws7J397Xr18CrWUur9rX34a9a4UCw4fAr9xJw1vvF1qvF1IqFyY9rWvkF4a vF1jy39Fga17trDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UtHUgUUUUU= X-CM-SenderInfo: xudq5x5drntxqwsxqiywtou0bp/1tbiqRudTGc9e4T0vgAAsM From: Ran Xiaokai The rcu callback free_asym_cap_entry() simply calls kfree(). It's better to directly call kfree_rcu(). Signed-off-by: Ran Xiaokai --- kernel/sched/topology.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index 9748a4c8d668..60ff3ba1d6ff 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -1382,12 +1382,6 @@ asym_cpu_capacity_classify(const struct cpumask *sd_span, } -static void free_asym_cap_entry(struct rcu_head *head) -{ - struct asym_cap_data *entry = container_of(head, struct asym_cap_data, rcu); - kfree(entry); -} - static inline void asym_cpu_capacity_update_data(int cpu) { unsigned long capacity = arch_scale_cpu_capacity(cpu); @@ -1438,7 +1432,7 @@ static void asym_cpu_capacity_scan(void) list_for_each_entry_safe(entry, next, &asym_cap_list, link) { if (cpumask_empty(cpu_capacity_span(entry))) { list_del_rcu(&entry->link); - call_rcu(&entry->rcu, free_asym_cap_entry); + kfree_rcu(entry, rcu); } } @@ -1449,7 +1443,7 @@ static void asym_cpu_capacity_scan(void) if (list_is_singular(&asym_cap_list)) { entry = list_first_entry(&asym_cap_list, typeof(*entry), link); list_del_rcu(&entry->link); - call_rcu(&entry->rcu, free_asym_cap_entry); + kfree_rcu(entry, rcu); } } From patchwork Wed Nov 20 06:47:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ran Xiaokai X-Patchwork-Id: 13880752 Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.5]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6243516F8E5; Wed, 20 Nov 2024 06:48:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.31.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732085306; cv=none; b=M5zD54bPM8G/jAijl3XfoTyQYzx2krR0Pz86hNhZRAB/BM5mC4P24Xc3CEYAQdeOgK2WScnGNcM/ieprTX2hsDg4pwbzA97k9j138UARrYYnvIkUqi0XqiRFunGmiyZ98QdhEvuZipmqGyzKt+kQZ9TKKbUGfcGtZejTSZZtpmU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732085306; c=relaxed/simple; bh=gF13eQVa0Ocaq1UGdDe667AyqYd4x7jSGMSKC4l9o1c=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=K01y6B00IA50FlSjJX31YQnLh9QE/1cJo+YQWvg1o3lQfrGSgpi1SIFcmWfOsancBpPu3eVvqhpfSmE7gh8cm2ThQtlcUS3UzCLpOudUT8IbbMdl8GqcFWZbIAVwtBRHJBsslEDADBqSPsskoDWQWqgWbGdvyZSTvhiS+0a9fh4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=nsoYeUbK; arc=none smtp.client-ip=220.197.31.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="nsoYeUbK" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=6ho3G nqgGCt9fsxOHh+xodC+HlFBZfqO/I/iBHnLVCg=; b=nsoYeUbKFSvmbSvLA/Q68 lK8AQuvwO95fHEoj+QhFjv6DpRUBO6APzClm9J1nlFWnyGY2fAnqcouRAZfLE8v5 NUE6OEKlGBtiRep6ui6X11Wpd9p57xnQG0ukhOXDVFJxazJSPm4bgc7UaQigBtok 39+ru3S1RRuuz5Rn0ppXYs= Received: from localhost.localdomain (unknown [193.203.214.57]) by gzga-smtp-mtada-g1-2 (Coremail) with SMTP id _____wDnD1j4hT1nTO3OIQ--.22522S6; Wed, 20 Nov 2024 14:47:26 +0800 (CST) From: Ran Xiaokai To: juri.lelli@redhat.com, vincent.guittot@linaro.org, mingo@redhat.com, peterz@infradead.org, pshelar@ovn.org, davem@davemloft.net Cc: linux-kernel@vger.kernel.org, ran.xiaokai@zte.com.cn, linux-perf-users@vger.kernel.org, netdev@vger.kernel.org, dev@openvswitch.org Subject: [PATCH 2/4] perf/core: convert call_rcu(free_ctx) to kfree_rcu() Date: Wed, 20 Nov 2024 06:47:14 +0000 Message-Id: <20241120064716.3361211-3-ranxiaokai627@163.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241120064716.3361211-1-ranxiaokai627@163.com> References: <20241120064716.3361211-1-ranxiaokai627@163.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID: _____wDnD1j4hT1nTO3OIQ--.22522S6 X-Coremail-Antispam: 1Uf129KBjvdXoWrtF1fXw17AF1rKF17Gw18uFg_yoWkuwb_Xw 47JF9Fgw4jya9xZryDua13tr10qa9rta1Fyrs7tFZrJFy5Jws0yr1SyrZrZr95XanrZa43 KwsxXFn0qw48AjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU1p6zUUUUUU== X-CM-SenderInfo: xudq5x5drntxqwsxqiywtou0bp/1tbiqRudTGc9e4T0vgABsN From: Ran Xiaokai The rcu callback free_ctx() simply calls kfree(). It's better to directly call kfree_rcu(). Signed-off-by: Ran Xiaokai --- kernel/events/core.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/kernel/events/core.c b/kernel/events/core.c index 065f9188b44a..7f4cc9c41bbe 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -1210,14 +1210,6 @@ static void free_task_ctx_data(struct pmu *pmu, void *task_ctx_data) kmem_cache_free(pmu->task_ctx_cache, task_ctx_data); } -static void free_ctx(struct rcu_head *head) -{ - struct perf_event_context *ctx; - - ctx = container_of(head, struct perf_event_context, rcu_head); - kfree(ctx); -} - static void put_ctx(struct perf_event_context *ctx) { if (refcount_dec_and_test(&ctx->refcount)) { @@ -1225,7 +1217,7 @@ static void put_ctx(struct perf_event_context *ctx) put_ctx(ctx->parent_ctx); if (ctx->task && ctx->task != TASK_TOMBSTONE) put_task_struct(ctx->task); - call_rcu(&ctx->rcu_head, free_ctx); + kfree_rcu(ctx, rcu_head); } } From patchwork Wed Nov 20 06:47:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ran Xiaokai X-Patchwork-Id: 13880748 X-Patchwork-Delegate: kuba@kernel.org Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.2]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 29366184F; Wed, 20 Nov 2024 06:48:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.2 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732085300; cv=none; b=c9sTUOEHgwpFzIfSt3Ez6Skk1yJpFLy13LnYVct6YnYmZVxANqvxzgXWtl/JSxsyjZ9LaN4z3L1MTmkZSfUk1l2Kkqk03Q063RWpNVDUdmJNlHxihKeqBnDUqkRd/xVnjN9GyBjZjA0CODDHABOMSu/wfAuA2FhMqLiuq1gOn8Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732085300; c=relaxed/simple; bh=n8SLLWK3MQkDR1z3H0Re1trDYjqiMeMiHJSiS1serxo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ti3LFY6XxYdBU7ZEM+CeSuwrhUxR5JdeQAh98ylsFpLikLb3lAd0Mnc98yhYNdB30QDzfkTWswCd1Ne0jz3KWHm924n/vXQYX3XKC//VeSWQ6Hqq5WL4EeZeYRnSLc5H5A80E4Q+7RkY8YwjaxXBcZ9+Br9S6Pngq+rLk9/sKhs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=TqWUkayO; arc=none smtp.client-ip=117.135.210.2 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="TqWUkayO" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=FEtQH Q7xxa/NvxCI7Kpu5Ck4lLcNoLVOFcsGOzxZzKs=; b=TqWUkayO7aHCTDFsKQaXT cXVDsKQObmdF3MmhUi3GmQhJjskQ0MYLjrpPNkzPReEpNwqPZT6eRp4XWi8A1lGJ jC0Tc98WFspo9G+cbsVKycYdqKCBFEHka+jlPlpAEzCh+4Ixz0hqTqfzPRWtvdBq qTFi77E0jIjUbbPSp7kYso= Received: from localhost.localdomain (unknown [193.203.214.57]) by gzga-smtp-mtada-g1-2 (Coremail) with SMTP id _____wDnD1j4hT1nTO3OIQ--.22522S7; Wed, 20 Nov 2024 14:47:28 +0800 (CST) From: Ran Xiaokai To: juri.lelli@redhat.com, vincent.guittot@linaro.org, mingo@redhat.com, peterz@infradead.org, pshelar@ovn.org, davem@davemloft.net Cc: linux-kernel@vger.kernel.org, ran.xiaokai@zte.com.cn, linux-perf-users@vger.kernel.org, netdev@vger.kernel.org, dev@openvswitch.org Subject: [PATCH 3/4] net: openvswitch: convert call_rcu(dp_meter_instance_free_rcu) to kvfree_rcu() Date: Wed, 20 Nov 2024 06:47:15 +0000 Message-Id: <20241120064716.3361211-4-ranxiaokai627@163.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241120064716.3361211-1-ranxiaokai627@163.com> References: <20241120064716.3361211-1-ranxiaokai627@163.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID: _____wDnD1j4hT1nTO3OIQ--.22522S7 X-Coremail-Antispam: 1Uf129KBjvdXoWrtrWfGw4kuF4xuryUAF1xAFb_yoWkCwb_ZF s8Za1DGF43Ja40qrsrCFs5Xr4fKF1fuF18Xws7Ka92kas8tws5Gr17WFZ3Cr93W3yUCr9a qwn0qw1fCF15GjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU0jsjUUUUUU== X-CM-SenderInfo: xudq5x5drntxqwsxqiywtou0bp/1tbiqRudTGc9e4T0vgACsO X-Patchwork-Delegate: kuba@kernel.org From: Ran Xiaokai The rcu callback dp_meter_instance_free_rcu() simply calls kvfree(). It's better to directly call kvfree_rcu(). Signed-off-by: Ran Xiaokai --- net/openvswitch/meter.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/net/openvswitch/meter.c b/net/openvswitch/meter.c index cc08e0403909..d99efb9ce1a0 100644 --- a/net/openvswitch/meter.c +++ b/net/openvswitch/meter.c @@ -83,14 +83,6 @@ static void dp_meter_instance_free(struct dp_meter_instance *ti) kvfree(ti); } -static void dp_meter_instance_free_rcu(struct rcu_head *rcu) -{ - struct dp_meter_instance *ti; - - ti = container_of(rcu, struct dp_meter_instance, rcu); - kvfree(ti); -} - static int dp_meter_instance_realloc(struct dp_meter_table *tbl, u32 size) { @@ -108,7 +100,7 @@ dp_meter_instance_realloc(struct dp_meter_table *tbl, u32 size) new_ti->dp_meters[i] = ti->dp_meters[i]; rcu_assign_pointer(tbl->ti, new_ti); - call_rcu(&ti->rcu, dp_meter_instance_free_rcu); + kvfree_rcu(ti, rcu); return 0; } From patchwork Wed Nov 20 06:47:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ran Xiaokai X-Patchwork-Id: 13880751 X-Patchwork-Delegate: kuba@kernel.org Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.2]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7F566157466; Wed, 20 Nov 2024 06:48:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.2 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732085302; cv=none; b=rTTohinLy4PdgvgSh+Xpj4p0WbkcbSTlKtRixUvYWC9f7RncPhUB6yV9dVjWgDyJs+o+/JsnmxHeeLhVMg8bzM1XFV4Oi0m4r6vX27Nz9/i8+PYEoYC2K92Z08GbJZJX+WYacLmyqfXpJIBvdxXsdJdxoNAXW/k7GfZPLxXpetE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732085302; c=relaxed/simple; bh=03yhgGmdxKAMM7hG9WNCGsQUI/y8wqpw8cVe4oK+ZEY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lg9OSrx8dCcVMzKO3G99roeDiSv4qdWo2tyP96hTKhSNK+ILrsCvZo/xovp8NUJKYb1UNPSANvea3I8wgzNVvlOUJpWbI+fzHIzhez6mjlsoLFY21POPlrRJoUKHtuM1sHN7W6Fz8NEFVeLHrhq11DPGx+ksJYeezroTabhck5k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=SXblrgP/; arc=none smtp.client-ip=117.135.210.2 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="SXblrgP/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=RxxSJ zuhen+I5MBVyFiCFH36XjMts/uli22nGaC4/a8=; b=SXblrgP/s223E1obJDxG1 3ZlhfOOEKXsr8qJpMa5agKnWl7mc2WFcmYD0krKhJOuVg/muS2PIj6t0gYH7WwKG IwpKwJhBuHsP7pHk+il8paqY+nsIehYnW02ZMwFLSP72VPtHoe4ws/RZMjRzcrVw HKh9lOVNpX3kBY/CntqmH0= Received: from localhost.localdomain (unknown [193.203.214.57]) by gzga-smtp-mtada-g1-2 (Coremail) with SMTP id _____wDnD1j4hT1nTO3OIQ--.22522S8; Wed, 20 Nov 2024 14:47:30 +0800 (CST) From: Ran Xiaokai To: juri.lelli@redhat.com, vincent.guittot@linaro.org, mingo@redhat.com, peterz@infradead.org, pshelar@ovn.org, davem@davemloft.net Cc: linux-kernel@vger.kernel.org, ran.xiaokai@zte.com.cn, linux-perf-users@vger.kernel.org, netdev@vger.kernel.org, dev@openvswitch.org Subject: [PATCH 4/4] net: sysfs: convert call_rcu() to kvfree_rcu() Date: Wed, 20 Nov 2024 06:47:16 +0000 Message-Id: <20241120064716.3361211-5-ranxiaokai627@163.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241120064716.3361211-1-ranxiaokai627@163.com> References: <20241120064716.3361211-1-ranxiaokai627@163.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID: _____wDnD1j4hT1nTO3OIQ--.22522S8 X-Coremail-Antispam: 1Uf129KBjvJXoW7WFWfWF4DCry8XrW3Xr4Dtwb_yoW8Xw17pr 45Gr9xt395Xr1kJrZ7Kr1IgF1UWr4jqF15WFn2kw1ftwn8Z34v9F17C340qFn5ArW8JFWU Zw4Y9rsxAF48AFDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UdOz3UUUUU= X-CM-SenderInfo: xudq5x5drntxqwsxqiywtou0bp/1tbiqRudTGc9e4T0vgADsP X-Patchwork-Delegate: kuba@kernel.org From: Ran Xiaokai The rcu callback rps_dev_flow_table_release() simply calls vfree(). It's better to directly call kvfree_rcu(). Signed-off-by: Ran Xiaokai --- net/core/net-sysfs.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 2d9afc6e2161..8ba2251af077 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c @@ -947,13 +947,6 @@ static ssize_t show_rps_dev_flow_table_cnt(struct netdev_rx_queue *queue, return sysfs_emit(buf, "%lu\n", val); } -static void rps_dev_flow_table_release(struct rcu_head *rcu) -{ - struct rps_dev_flow_table *table = container_of(rcu, - struct rps_dev_flow_table, rcu); - vfree(table); -} - static ssize_t store_rps_dev_flow_table_cnt(struct netdev_rx_queue *queue, const char *buf, size_t len) { @@ -1008,7 +1001,7 @@ static ssize_t store_rps_dev_flow_table_cnt(struct netdev_rx_queue *queue, spin_unlock(&rps_dev_flow_lock); if (old_table) - call_rcu(&old_table->rcu, rps_dev_flow_table_release); + kvfree_rcu(old_table, rcu); return len; } @@ -1046,7 +1039,7 @@ static void rx_queue_release(struct kobject *kobj) flow_table = rcu_dereference_protected(queue->rps_flow_table, 1); if (flow_table) { RCU_INIT_POINTER(queue->rps_flow_table, NULL); - call_rcu(&flow_table->rcu, rps_dev_flow_table_release); + kvfree_rcu(flow_table, rcu); } #endif