From patchwork Wed Feb 1 15:08:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 51402 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp334549wrn; Wed, 1 Feb 2023 07:14:43 -0800 (PST) X-Google-Smtp-Source: AK7set9xzqFluSJEZMP/iWN0A0OlbpaCMFUkAHCW9XRSj4tfebzA5W51ldpdDcpmBPMyPcM+/uqm X-Received: by 2002:a17:902:dac6:b0:196:8124:dbe8 with SMTP id q6-20020a170902dac600b001968124dbe8mr3790640plx.61.1675264483034; Wed, 01 Feb 2023 07:14:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675264483; cv=none; d=google.com; s=arc-20160816; b=bTH3IUv1Ed2kkxhPYFOi4Fja3F8e0VL3Eu3lr2LgsLirnTQkbwoJWPx+SMFP2v5B8j DZDgUDkBnMa3vhcOTHrWWI8D4RuLkmtRZYC/R4+asbr24lW6+Af4ASFF0ujZG4Xg+mD7 ORxOkEZfJOyWpUHM3Yf6CKT4HF2iBypLTu0/PUWsWl4Q8S+HVvmKpdf5/Bd7/rMDnFZV XeSMT6bf1ASJ4A2H3oSpb5gGqTQ2dxyNSsjdphaCjipLCuV+n6nZ227YhDpTNn1svZ++ 6LYlkDS9dwYh2nx+HcBoW8/DNaxvamm7M6Uc0lu2BoeeUnYvXfoYH6SXhhRtJAlRV698 ydDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=FL6Oc4kZz3pEC+42YRGjUorvq4as+oQYBQ3Rk/f90Ak=; b=P7Sn2V8aFqI5undizFWgX918vUkTkpBvC7rUxWnpnnYXA/YUyxS8X5HubYNDOZ+KeD 7BXT5PFRAB70cTjjyX9q/dMTwRpFTrpXfbXMVa+siGlg/CMsjw0zfeeNq7zau/V/DosJ 1hcVC2kWFRdgBQArrv2++zPhxNlVvxq9UGBVcIDHIUQYJhjwrEnTARjGvEZb40BwDwfF a9O0qAuG5IrDEMBxQ2EEwBNSYjzZuJ3BAAkg+qRLqMna7VBonQvGiEh894HgxWCEFDJu gpQ32MzpI6mjY1L+dn1ScOWWW63TgQGZDa37azzxDXlUCmiZ4TOU+jumvETP3z74VA1h J6Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AR9ckEL0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f7-20020a170902ce8700b00188e5c9e026si21897875plg.102.2023.02.01.07.14.29; Wed, 01 Feb 2023 07:14:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AR9ckEL0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232680AbjBAPKf (ORCPT + 99 others); Wed, 1 Feb 2023 10:10:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232866AbjBAPJl (ORCPT ); Wed, 1 Feb 2023 10:09:41 -0500 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41FDE65EDE; Wed, 1 Feb 2023 07:08:20 -0800 (PST) Received: by mail-ej1-x632.google.com with SMTP id ml19so28739296ejb.0; Wed, 01 Feb 2023 07:08:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FL6Oc4kZz3pEC+42YRGjUorvq4as+oQYBQ3Rk/f90Ak=; b=AR9ckEL0F6ZlprE/CI0uy/u3yv2fo+PiSDAmBvbENe1OfrVUEbQDzo787z9Qz2f98J KYsAwCWWlKRXvfc+isW1EQ4+JPh1HFDHb030whCmUfp2nvHij65eBd0h20MXAYMefaz7 f4k/AH/xdVeiMmiCKZ3VfuABC+Q4fV8j7Og3nyrMa2uT2fCdjHlDUbCtaCD9O8T2eWDa jBLaHtRgA+mWDSWTAWrczod4M+9/U2XItsPOwNoq//gupzLKVZWkpYxV+76/U/1IvI9f SS9DBVc9Kx3ogTtVLloOSrU3Ok820OMZer0l3KY1TxiBhMuNJPXdt6soiX0BF1866IBV +XtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FL6Oc4kZz3pEC+42YRGjUorvq4as+oQYBQ3Rk/f90Ak=; b=LuPCSeVYCnJh87105yL8LGsPRUkv/NUtKjwzPGVylWGd72DmS3u3hCZj2uHRwqYLOP VofinvRz66QIQuP0VSmSFzWg0vyvZtAAhdPPjjPaHzOLX1+VggnDRyPkweAv7HtXWeZ2 d+sjxvx/OaCTSKS8SBbfgS8KrpoWLPbRZc01bkMkAHV6FYK9sBIuE16nsI9Je0Q6GokK np71aFwU/Y4oJF5XajVV7SmYTgnjwFS0V9l0ziDHK7Un79K8mGJ1QDKAD5WMWXldq2pz bFlJvTv6vegARy1eL9bhaDT8NRqicbmsxrCGXNZmF1VEgaIfklX0b1sK7ogzeFVtlc1H chMw== X-Gm-Message-State: AO0yUKVxkcYaDu09iddSXiCfylUOGcF6LWVsAT84t8tvq9wlUp/v2bLq bF1nlSs0aZ/jqr9OjAnWyC+b8LciDpsS0A== X-Received: by 2002:a17:906:7050:b0:886:8cd4:ef9d with SMTP id r16-20020a170906705000b008868cd4ef9dmr2685887ejj.22.1675264098637; Wed, 01 Feb 2023 07:08:18 -0800 (PST) Received: from pc638.lan ([155.137.26.201]) by smtp.gmail.com with ESMTPSA id qc26-20020a170906d8ba00b008787e94c5ccsm9585774ejb.184.2023.02.01.07.08.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 07:08:18 -0800 (PST) From: "Uladzislau Rezki (Sony)" To: LKML , RCU , "Paul E . McKenney" Cc: Uladzislau Rezki , Oleksiy Avramchenko , Jens Axboe , Philipp Reisner , Bryan Tan , Steven Rostedt , Eric Dumazet , Bob Pearson , Ariel Levkovich , Theodore Ts'o , Julian Anastasov Subject: [PATCH 01/13] rcu/kvfree: Add kvfree_rcu_mightsleep() and kfree_rcu_mightsleep() Date: Wed, 1 Feb 2023 16:08:07 +0100 Message-Id: <20230201150815.409582-2-urezki@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230201150815.409582-1-urezki@gmail.com> References: <20230201150815.409582-1-urezki@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756642130699177188?= X-GMAIL-MSGID: =?utf-8?q?1756642130699177188?= These two macroses will replace single-argument k[v]free_rcu() ones. By adding an extra _mightsleep prefix we can avoid of situations when someone intended to give a second argument but forgot to do it in a code where sleeping is illegal. Signed-off-by: Uladzislau Rezki (Sony) --- include/linux/rcupdate.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 822ff7b4bb1e..094321c17e48 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -1013,6 +1013,9 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) #define kvfree_rcu(...) KVFREE_GET_MACRO(__VA_ARGS__, \ kvfree_rcu_arg_2, kvfree_rcu_arg_1)(__VA_ARGS__) +#define kvfree_rcu_mightsleep(ptr) kvfree_rcu_arg_1(ptr) +#define kfree_rcu_mightsleep(ptr) kvfree_rcu_mightsleep(ptr) + #define KVFREE_GET_MACRO(_1, _2, NAME, ...) NAME #define kvfree_rcu_arg_2(ptr, rhf) \ do { \ From patchwork Wed Feb 1 15:08:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 51403 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp334626wrn; Wed, 1 Feb 2023 07:14:51 -0800 (PST) X-Google-Smtp-Source: AK7set9uhO4kbxOyldEZiOn1SVHZgxM+sjNozk0g6rHPtJ0ZvqxNJSfVFICY4yPkqa6ekOc1KQj+ X-Received: by 2002:a05:6a00:815:b0:590:6ff5:5704 with SMTP id m21-20020a056a00081500b005906ff55704mr3158328pfk.8.1675264491512; Wed, 01 Feb 2023 07:14:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675264491; cv=none; d=google.com; s=arc-20160816; b=bLA0uK5MV8mNKQdtrcLB4wOs6/XlFyZSrMpOwNH3ds49Ujp7d4xakWUyQF+HAyLwnM ru2UNVHQT19qMj6qGaIXyZGXNuH0TsiWHgkXeh0qDGSdCqzP/kAFP1sXwruHciRLGQu1 QDS4WaTfdYqxLWHEpPnVeCFivX6iYv7u0gdOQhm8GiunvK5uJ9LKLpVeU6kM5FIPXrP1 MqaMx6AFvWeZyxs2GOTnvsN1SfiiG9B82sZame4ay802YTCZ7P3tqxoVQXKoEKKOdcxY j/0ZP6v5XVdUMU1dtQeRGh7dA1MCcepykblbN9hKiKwdIZeXBybPTy6Tw2bZNuQKPV3i SapA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=oWGEYERPvz3Z7XS0c9NWA+7/cG741tA5LjUXI+xdY9A=; b=T1M5HHmFDka3CQYXArvvpuIVTFs/+oG7Q26YSW0mLoHRafXXlNOHdAghfXrrXWo+Mv zMyF/YviEN6WFo58BrynUxb16PyeaOkRWyjixBxnJK3MpMtJjbt079GWNkdgB2HDHQh7 gG8O2FNTgPrWasVy1SyVg01A93nbjQ/OMVJ905Y7neWPxmu2RCmizDyOxsfPK/h5QYk9 xsn+47Oi6syAkXuk8b7krn5JHGMrfWIhhRfl1a+wtvWHF/Nimux8JgZlXGXP9AAfQuGy etTAnW60ueP+rwWZ5cRBOvUGPXtXmSzrcVvn70dwBEdNl2dGVT9Yt7VV+cLrNTbwGUy7 qB1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=a5TGg72O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e25-20020aa78259000000b00593c67645d8si9157191pfn.118.2023.02.01.07.14.39; Wed, 01 Feb 2023 07:14:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=a5TGg72O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232723AbjBAPKz (ORCPT + 99 others); Wed, 1 Feb 2023 10:10:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232860AbjBAPJl (ORCPT ); Wed, 1 Feb 2023 10:09:41 -0500 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2A2A66F80; Wed, 1 Feb 2023 07:08:21 -0800 (PST) Received: by mail-ej1-x635.google.com with SMTP id qw12so36369370ejc.2; Wed, 01 Feb 2023 07:08:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oWGEYERPvz3Z7XS0c9NWA+7/cG741tA5LjUXI+xdY9A=; b=a5TGg72O4JVsbdjy8Fdwnjt1CZo2FFCFYgUY9zkr98rstihvKl+h2kTYnnQZj3XtIQ VrLdkj6Y8gRLKhKPrEtocVaVOw5Kqx9UYfjDWXRsHFay9d1QtX2Y1PDqy4dQKWewU3TC 3UYtypps+hRIw0eo2P1np+vhLCLx7bfF2s8dlvC5L9lZRCzVkvRPlM6ZHeNJLS3glfeb afq1QNf+AfCNLiFhWe9Un0v4bsrFoG25K6Cbdnql4+Cbv+WM0zsZDjoBhbT7TY3FuVQq zf39dosn0iqhtolYkYxX7Mn7zR44cAUFhAxTGsdKOMhfaM3AINRsuKah8qgIMRjt1HXL j9ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oWGEYERPvz3Z7XS0c9NWA+7/cG741tA5LjUXI+xdY9A=; b=8C1hoTCx3NWojKfwaYeBcKwTWkTESWptWmMn4lZo/Q175/u0kR1hzftoA+l+qvIiWR 1apW2wd0+GiyAHJKajqS3Omq0DexMnw9UUSSbxJhkLuyuU3S1J5NdMz1HfgUWmrg+ZWk lZTe5lNkWuRH8evb1BFs1I/VFP7jt5w7AJc413btTPdrjmRR6LT+Lf0RcbhMwDqpgYeJ maHlwF79Cx9IcR28TQDwYhZiHDzG0C3DkvHK2dpBR+o2QxNH+WmIHbyUMUZaI6Ju7z23 5TMH6NppCfJ/6KACz4R60GvM4xejZ+O5e7EkkwkcYSmOVL1fV8fKzNuBuk2I7QhNJ2qf TRyQ== X-Gm-Message-State: AO0yUKXaWUQPtzoeiCsfmNIwdlHAcw7LvV/wvnP9uJqgobjt/9emXiaK XKoux0CBYXzAZev/tqDWf1JpaRWSXcYyPw== X-Received: by 2002:a17:906:434b:b0:878:72f7:bd87 with SMTP id z11-20020a170906434b00b0087872f7bd87mr2475279ejm.6.1675264099752; Wed, 01 Feb 2023 07:08:19 -0800 (PST) Received: from pc638.lan ([155.137.26.201]) by smtp.gmail.com with ESMTPSA id qc26-20020a170906d8ba00b008787e94c5ccsm9585774ejb.184.2023.02.01.07.08.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 07:08:19 -0800 (PST) From: "Uladzislau Rezki (Sony)" To: LKML , RCU , "Paul E . McKenney" Cc: Uladzislau Rezki , Oleksiy Avramchenko , Jens Axboe , Philipp Reisner , Bryan Tan , Steven Rostedt , Eric Dumazet , Bob Pearson , Ariel Levkovich , Theodore Ts'o , Julian Anastasov , Lars Ellenberg Subject: [PATCH 02/13] drbd: Rename kvfree_rcu() to kvfree_rcu_mightsleep() Date: Wed, 1 Feb 2023 16:08:08 +0100 Message-Id: <20230201150815.409582-3-urezki@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230201150815.409582-1-urezki@gmail.com> References: <20230201150815.409582-1-urezki@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756642139055304506?= X-GMAIL-MSGID: =?utf-8?q?1756642139055304506?= The kvfree_rcu()'s single argument name is deprecated therefore rename it to kvfree_rcu_mightsleep() variant. The goal is explicitly underline that it is for sleepable contexts. Cc: Jens Axboe Cc: Philipp Reisner Cc: Lars Ellenberg Signed-off-by: Uladzislau Rezki (Sony) --- drivers/block/drbd/drbd_nl.c | 6 +++--- drivers/block/drbd/drbd_receiver.c | 4 ++-- drivers/block/drbd/drbd_state.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index 60757ac31701..f49f2a5282e1 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c @@ -1615,7 +1615,7 @@ int drbd_adm_disk_opts(struct sk_buff *skb, struct genl_info *info) drbd_send_sync_param(peer_device); } - kvfree_rcu(old_disk_conf); + kvfree_rcu_mightsleep(old_disk_conf); kfree(old_plan); mod_timer(&device->request_timer, jiffies + HZ); goto success; @@ -2446,7 +2446,7 @@ int drbd_adm_net_opts(struct sk_buff *skb, struct genl_info *info) mutex_unlock(&connection->resource->conf_update); mutex_unlock(&connection->data.mutex); - kvfree_rcu(old_net_conf); + kvfree_rcu_mightsleep(old_net_conf); if (connection->cstate >= C_WF_REPORT_PARAMS) { struct drbd_peer_device *peer_device; @@ -2860,7 +2860,7 @@ int drbd_adm_resize(struct sk_buff *skb, struct genl_info *info) new_disk_conf->disk_size = (sector_t)rs.resize_size; rcu_assign_pointer(device->ldev->disk_conf, new_disk_conf); mutex_unlock(&device->resource->conf_update); - kvfree_rcu(old_disk_conf); + kvfree_rcu_mightsleep(old_disk_conf); new_disk_conf = NULL; } diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 757f4692b5bd..e197b2a465d2 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -3759,7 +3759,7 @@ static int receive_protocol(struct drbd_connection *connection, struct packet_in drbd_info(connection, "peer data-integrity-alg: %s\n", integrity_alg[0] ? integrity_alg : "(none)"); - kvfree_rcu(old_net_conf); + kvfree_rcu_mightsleep(old_net_conf); return 0; disconnect_rcu_unlock: @@ -4127,7 +4127,7 @@ static int receive_sizes(struct drbd_connection *connection, struct packet_info rcu_assign_pointer(device->ldev->disk_conf, new_disk_conf); mutex_unlock(&connection->resource->conf_update); - kvfree_rcu(old_disk_conf); + kvfree_rcu_mightsleep(old_disk_conf); drbd_info(device, "Peer sets u_size to %lu sectors (old: %lu)\n", (unsigned long)p_usize, (unsigned long)my_usize); diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c index 75d13ea0024f..2aeea295fa28 100644 --- a/drivers/block/drbd/drbd_state.c +++ b/drivers/block/drbd/drbd_state.c @@ -2071,7 +2071,7 @@ static int w_after_conn_state_ch(struct drbd_work *w, int unused) conn_free_crypto(connection); mutex_unlock(&connection->resource->conf_update); - kvfree_rcu(old_conf); + kvfree_rcu_mightsleep(old_conf); } if (ns_max.susp_fen) { From patchwork Wed Feb 1 15:08:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 51408 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp335544wrn; Wed, 1 Feb 2023 07:16:14 -0800 (PST) X-Google-Smtp-Source: AK7set+kMWk20qYKTa64a5ytUuhXBZSqm57ZSV83QYUMi0NHM+H0wJbzsUZCEXoMcZUIFUmKOcs9 X-Received: by 2002:a17:90a:e7c2:b0:230:1acb:191c with SMTP id kb2-20020a17090ae7c200b002301acb191cmr2650013pjb.14.1675264574175; Wed, 01 Feb 2023 07:16:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675264574; cv=none; d=google.com; s=arc-20160816; b=RI6OwDc2F8fai+O7IPpUvLrEe/b0UqjgXuG/qA7fY5G8zsZmbBfEwZEuJKz8MX3WKa tEMlesgC4E32KevOW4/hlegwkQWn/YwuiEUci5EmSkh/u391yE6tTK2Wju7C/kJ+ki4i wVJECyXkISxh3pgCF2cOaOaPtlh57+Gh5bkz6tWLDmyg7JPwnfYJFMmheRiHnL/3lktD P5Y3UyO25WpEs/ZLDX0xLqLO+62W6YEKDCg7VxbQfAs+Cm6r92ewYSR1e8b3zcbgs1n6 kPj3h9wcGntJj+k31HDiBxs19VtZgv5MW4YSwAlUdf29nRjTw+sBdHt+3UOpy5PkoZP/ PqGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1f2sZTLCh+6MjnBo1NM4qx8aN8UK3+QyFktme+HJb1M=; b=sTGHdSOGZLWhh85HQtkJkvGg8FUXe4L4YWg6o0TyM1t5hf3kZWsL0ZmWjViSEkfxgb 9ThxcqGm1T5NPSfjyKrF7XtyMREUk714iRICh/xf8QAZBwNYiif5vL1KwIGXSiKmfFzo 8vldHKy+dxaiH+Du4rL3OYvvOu+ctjHt0T7JAM/xFrGMCNlD2h5nlgYyflCxpDo3/Lnq 15luXN6LCwHpOVt0WgH85gm88zko8106O9O/V29oupSFNe+7RAjm2KJTZB652vNlK/10 y2+QE6+IwegvtE8ArD+1H719mfopHB3OelJNYpz3RlOAvcKSxqQoKSTsqS+TnbKzzwc6 kOxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dKmAu0Gx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v7-20020a17090a898700b0022ca174ebc9si1886075pjn.102.2023.02.01.07.16.01; Wed, 01 Feb 2023 07:16:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dKmAu0Gx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229651AbjBAPOx (ORCPT + 99 others); Wed, 1 Feb 2023 10:14:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232789AbjBAPJl (ORCPT ); Wed, 1 Feb 2023 10:09:41 -0500 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3149F66F8B; Wed, 1 Feb 2023 07:08:22 -0800 (PST) Received: by mail-ej1-x631.google.com with SMTP id m2so51835346ejb.8; Wed, 01 Feb 2023 07:08:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1f2sZTLCh+6MjnBo1NM4qx8aN8UK3+QyFktme+HJb1M=; b=dKmAu0GxbikreE6kPJmqHkddGR4hdJEwSy/Hyn9dorAla/AcEyCzBi0e0E5WKnnadE ZOoGHTpyuGBvNdYpaYDYcvhdpuYyY32EQuFRAWIhvBFh5vTxfR1pld3Ab6ScfSKARDAM sc2UMjZv2Pc+Fz5wbQlfV16JlBQkDyrYomHAkpzegrg7Jcwi5hSg3voaTAqOK7f84SP6 9T7cGzELd1jUt2G622d2YjrOKECc9MFeZ1qCKxQALvy/15evIShrh1+HKkkrn1/eRv+N NzUTzuo0yZ07hHQCVYZf4cxu/9+TaJ7wfNNg5s3LCxsCjX0IvX/o3RSYThcDvihaSgp7 N25A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1f2sZTLCh+6MjnBo1NM4qx8aN8UK3+QyFktme+HJb1M=; b=a+6ffcdrTbl+BddaUPsrX9kO2q58MlUEN9D+xb67k8X3PruIeGYrQkhAVR6sKLluQr 4WIKDYDaZd37VYv+EBRWIpqSFkH8QMHraFMoghiYRbPsUsqr3AGMu68IbzZGE9rk44T7 pxNJJiFHgG73Sr5IiPQmFfHRo8q4k0z2BP5KKjaGNy8G65qHv0o3ydFjekJeR9VbWmsd 0Sflf1NcQOmVdzNCTnEU1sci+pkjKFdn0iGCEh27WneqHsoLaOvHOe+d2ye8La6EC2p+ FH58yRv20QKF1E0v4n4TzB2AWkmT2EWjfQRE27a/QfRvSFILOUtI/hmKcNYmQNApNcY8 UmhQ== X-Gm-Message-State: AO0yUKVtgXmCd1vIZhsyGb2HIZgi/RCx/dKRk7EXLoFh8ZYqBLSwkgrG iODeC7q64TE6PsTa8PB+zf52WFJAf6CCLA== X-Received: by 2002:a17:907:2ce7:b0:886:7eae:26c4 with SMTP id hz7-20020a1709072ce700b008867eae26c4mr2498160ejc.5.1675264100689; Wed, 01 Feb 2023 07:08:20 -0800 (PST) Received: from pc638.lan ([155.137.26.201]) by smtp.gmail.com with ESMTPSA id qc26-20020a170906d8ba00b008787e94c5ccsm9585774ejb.184.2023.02.01.07.08.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 07:08:20 -0800 (PST) From: "Uladzislau Rezki (Sony)" To: LKML , RCU , "Paul E . McKenney" Cc: Uladzislau Rezki , Oleksiy Avramchenko , Jens Axboe , Philipp Reisner , Bryan Tan , Steven Rostedt , Eric Dumazet , Bob Pearson , Ariel Levkovich , Theodore Ts'o , Julian Anastasov , Vishnu Dasa Subject: [PATCH 03/13] misc: vmw_vmci: Rename kvfree_rcu() to kvfree_rcu_mightsleep() Date: Wed, 1 Feb 2023 16:08:09 +0100 Message-Id: <20230201150815.409582-4-urezki@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230201150815.409582-1-urezki@gmail.com> References: <20230201150815.409582-1-urezki@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756642226213026105?= X-GMAIL-MSGID: =?utf-8?q?1756642226213026105?= The kvfree_rcu()'s single argument name is deprecated therefore rename it to kvfree_rcu_mightsleep() variant. The goal is explicitly underline that it is for sleepable contexts. Cc: Bryan Tan Cc: Vishnu Dasa Signed-off-by: Uladzislau Rezki (Sony) Reviewed-by: Vishnu Dasa --- drivers/misc/vmw_vmci/vmci_context.c | 2 +- drivers/misc/vmw_vmci/vmci_event.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/misc/vmw_vmci/vmci_context.c b/drivers/misc/vmw_vmci/vmci_context.c index 172696abce31..f22b44827e92 100644 --- a/drivers/misc/vmw_vmci/vmci_context.c +++ b/drivers/misc/vmw_vmci/vmci_context.c @@ -687,7 +687,7 @@ int vmci_ctx_remove_notification(u32 context_id, u32 remote_cid) spin_unlock(&context->lock); if (notifier) - kvfree_rcu(notifier); + kvfree_rcu_mightsleep(notifier); vmci_ctx_put(context); diff --git a/drivers/misc/vmw_vmci/vmci_event.c b/drivers/misc/vmw_vmci/vmci_event.c index 2100297c94ad..5d7ac07623c2 100644 --- a/drivers/misc/vmw_vmci/vmci_event.c +++ b/drivers/misc/vmw_vmci/vmci_event.c @@ -209,7 +209,7 @@ int vmci_event_unsubscribe(u32 sub_id) if (!s) return VMCI_ERROR_NOT_FOUND; - kvfree_rcu(s); + kvfree_rcu_mightsleep(s); return VMCI_SUCCESS; } From patchwork Wed Feb 1 15:08:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 51406 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp334736wrn; Wed, 1 Feb 2023 07:15:03 -0800 (PST) X-Google-Smtp-Source: AK7set9o4mp7KXd8gX8ZXWI/AXXCRGc4zRx+LTVU7UDnYAihq55MJrw5TyRjN7i5KMYCVvnvyAhA X-Received: by 2002:a17:902:b490:b0:197:35fc:6a4a with SMTP id y16-20020a170902b49000b0019735fc6a4amr2427514plr.22.1675264502665; Wed, 01 Feb 2023 07:15:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675264502; cv=none; d=google.com; s=arc-20160816; b=Xrk3USMiduKGy9AaOwc5SYIex53oh2IlzEj0orEUKCqhPw3GkKKZmVYuW/qQqAoR8g fFisNB9cXoRJcxo+R1ovUFbu8x2VbakG/Bc5YJrLOXRDvCftLb1c/hAIApfVpXjzX08E 5S6qotrcy2+nRWe622qqq1SVEzGypbvt6rdohTf1csqPVqVhTuYqiYx/AKUFofwTGzYz cZ45CYcF7zMUCKggj719qDYtM8iQnBuDpRb41/QAOV+IHPHJbcro0t27K9tP1e1O+c8V Q7VP9tqy5jEF17Jr4NIqDbt4UgmaWK344ShjWUMRGMF3RV+w/MYgvMZYXRhUVhkIAL/a yjsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bT+cSsz2JrZskcNzFL2BkroViG0oFNVaYfW1YmvtVLg=; b=snXljXWTbX12tv2KCWp7d/DlH3tols9AJAFV+OkDRi7tE+T7T1uhDwnQkuFcLHdCa6 tOtLuY3cNhb24F06G8TLNFL/77PijiAo4O2eq/B7Ij7a9u+08vJ8TIIG+nSYUcfcph2k r7jRhECmxwZZ3LT3e/BPL/M3kHnG62aQq7H0cHBTfznHZCuG8S0AA4xeGIjwgeGKiMS/ ssQ3EirbGggWIW4cIuW9oSjqRKp2qph/iy2vPB4Q7o9+ZNGL2FR32hrYjcVgr7Kj3a9m z8AVl8cqN8AoZAvUJdhvCHVgfmlkmN0I2gDUi7dON5BEVCrIFEff7pMVxmf3GeZ30hEM v7gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MbTXjK1a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q78-20020a632a51000000b00462a6f64703si20254421pgq.376.2023.02.01.07.14.49; Wed, 01 Feb 2023 07:15:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MbTXjK1a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232830AbjBAPK5 (ORCPT + 99 others); Wed, 1 Feb 2023 10:10:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232018AbjBAPJl (ORCPT ); Wed, 1 Feb 2023 10:09:41 -0500 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EC6966FA3; Wed, 1 Feb 2023 07:08:23 -0800 (PST) Received: by mail-ej1-x636.google.com with SMTP id hx15so32759982ejc.11; Wed, 01 Feb 2023 07:08:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bT+cSsz2JrZskcNzFL2BkroViG0oFNVaYfW1YmvtVLg=; b=MbTXjK1aKcldZ1ocYRQ8KR3IhAxYTzuOdQl734t9wmuLuz1vNvm2N6voBZm3Rdi4B2 modsjehD8rJK6TB3IicMeihhuJckxR9bFA+BOSDy/UeP3Xy2PGtavZFn4pga6QbEAnVI l5/jvA3fOO98TNL/u81nzHFyhZNrcXg8KYKQaxXqbkae2jX5OOoZEWNv4gOWS4VHv1Yd DJgnIHELt9l04IUvxl15YRvHxPqCfn8vLPeIOVe9yAzc/18J+EIP5+HGHYRulTtrstxH PHAwkLCbDtqhgzyUc6F8k0cFPZKgOaSUJQxQ3p2XzNKxEOFP9ZacBMtthZGZYvXOjM+P uJHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bT+cSsz2JrZskcNzFL2BkroViG0oFNVaYfW1YmvtVLg=; b=hW6HRpoQMSd1wtmRerwRLGMmyqKQL3UYLG6AW01bgf9GgJJ/ZW88aqDsvuqWAgZDuN 8lSeUW08LvXqY3Ggo4LMxJ1FBI8tfxNkzjRVeSC3tAbgjjwz7kCXJ4fl4JlnWzkW4Dm1 KqoKkFcd1Mei5eAq453UtW98nbJy+YsJa2i9SYztEYFopsxftJ+T9EiHRPnXzlDYfFm1 t4IL4FaI+ZGNLDwdqbIAk6qC+R/VU8qECUkvsUE3fKE65DdroyaQ88OUg/SrIxBChbli K2DLvXpk6U2ZjHuTiK4Geg4QbmmU+riZRWP6q2mg+pkFHOQWb9n+RHs8EjQORC+wdywe 3RDA== X-Gm-Message-State: AO0yUKUMvCo+SuV7vvqJWqJKiQOLkPGCgSQFQ3Bg3OrLSoktbHonkSUo LiHCRj5XnFiasX6fp2iwHonei/oXYJW3KA== X-Received: by 2002:a17:907:c20c:b0:883:3661:97e5 with SMTP id ti12-20020a170907c20c00b00883366197e5mr2107344ejc.50.1675264101634; Wed, 01 Feb 2023 07:08:21 -0800 (PST) Received: from pc638.lan ([155.137.26.201]) by smtp.gmail.com with ESMTPSA id qc26-20020a170906d8ba00b008787e94c5ccsm9585774ejb.184.2023.02.01.07.08.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 07:08:21 -0800 (PST) From: "Uladzislau Rezki (Sony)" To: LKML , RCU , "Paul E . McKenney" Cc: Uladzislau Rezki , Oleksiy Avramchenko , Jens Axboe , Philipp Reisner , Bryan Tan , Steven Rostedt , Eric Dumazet , Bob Pearson , Ariel Levkovich , Theodore Ts'o , Julian Anastasov Subject: [PATCH 04/13] tracing: Rename kvfree_rcu() to kvfree_rcu_mightsleep() Date: Wed, 1 Feb 2023 16:08:10 +0100 Message-Id: <20230201150815.409582-5-urezki@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230201150815.409582-1-urezki@gmail.com> References: <20230201150815.409582-1-urezki@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756642151126339487?= X-GMAIL-MSGID: =?utf-8?q?1756642151126339487?= The kvfree_rcu()'s single argument name is deprecated therefore rename it to kvfree_rcu_mightsleep() variant. The goal is explicitly underline that it is for sleepable contexts. Cc: Steven Rostedt (VMware) Signed-off-by: Uladzislau Rezki (Sony) Acked-by: Paul E. McKenney Acked-by: Uladzislau Rezki (Sony) --- kernel/trace/trace_osnoise.c | 2 +- kernel/trace/trace_probe.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c index 94c1b5eb1dc0..67392d872b67 100644 --- a/kernel/trace/trace_osnoise.c +++ b/kernel/trace/trace_osnoise.c @@ -160,7 +160,7 @@ static void osnoise_unregister_instance(struct trace_array *tr) if (!found) return; - kvfree_rcu(inst); + kvfree_rcu_mightsleep(inst); } /* diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c index 01ebabbbe8c9..32a7741dc731 100644 --- a/kernel/trace/trace_probe.c +++ b/kernel/trace/trace_probe.c @@ -1170,7 +1170,7 @@ int trace_probe_remove_file(struct trace_probe *tp, return -ENOENT; list_del_rcu(&link->list); - kvfree_rcu(link); + kvfree_rcu_mightsleep(link); if (list_empty(&tp->event->files)) trace_probe_clear_flag(tp, TP_FLAG_TRACE); From patchwork Wed Feb 1 15:08:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 51401 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp334488wrn; Wed, 1 Feb 2023 07:14:38 -0800 (PST) X-Google-Smtp-Source: AK7set8Bi1lKMxHY3bUvDCxCovDPnxQWqzTqk/LhFL89V6DvBvUuqCfhMjrXG4fep2y/tHWCmh8b X-Received: by 2002:a17:902:f54b:b0:195:f412:5e6f with SMTP id h11-20020a170902f54b00b00195f4125e6fmr4124318plf.48.1675264478199; Wed, 01 Feb 2023 07:14:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675264478; cv=none; d=google.com; s=arc-20160816; b=ZR6rdAUZBND+ImgXHfOkA19rcJpVA4D65D1gJe7BlyxluwrCnNaGSEYRzgh6t7EOMg s5QTLaaaOJ0bqDuMxLPzKHdY3ru+W+0WpLX/4d4ypBAZ+sAsane92UQxLTDF2haqaDBl govYA/YcUOU9KPhbnP5lggX5x8B5kxTpM9brr3MF9UP3UEbb7oopp7aGqpdC6kxpscYo KSJB9uAm0Vu1IHxJFKkL6qLavMMsVZzks9vQJwF90XihVlqmKIGYv9qE79iHBpGT98jE WbGqoLBzmX230Ej+YvM5Or+UAXCd5PFef1Sa31vGR5UKHEJ9XQiHCw1kCuHMBpSRyzhF er5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fO35H2/wXICWhJ+cuarq0XINTUHDojZ1200QGctnX2s=; b=z/2Y2elXvOJlVm1xDehbQPPn9XuIxOzkXQOHTQK+kQN1lL+kpCdPQl0Bx3R3xYnmLd +6ACIXkKXhg+RAtRkGCPs4UXRwaUerVc35brHMnBrDuB3+PNG9m+rPya62any/iiBW4p soXg6M/wW0Pi8gknrK5P4Al+xG2ttOMzGYrg+RhFG74PGItLiXra8HQq2v9gu21QhpOi hG+2orIWWeswOhli2ngP3swoYdtvKPsV2z1667fI3D94QN9p+tH7XmR+PE7rsmyoiJHg LTHJ5vkM4DcytwVKNRkP01Atgw3D4HCvQO9hRbCrHFFiz5gOZYfIFtawabDg5nc/xKUS WQWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=SUl+ss9v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y7-20020a170902864700b00188ef2314acsi18644926plt.527.2023.02.01.07.14.25; Wed, 01 Feb 2023 07:14:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=SUl+ss9v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232515AbjBAPKv (ORCPT + 99 others); Wed, 1 Feb 2023 10:10:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232905AbjBAPJo (ORCPT ); Wed, 1 Feb 2023 10:09:44 -0500 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBACC66FA4; Wed, 1 Feb 2023 07:08:24 -0800 (PST) Received: by mail-ej1-x62e.google.com with SMTP id m2so51835654ejb.8; Wed, 01 Feb 2023 07:08:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fO35H2/wXICWhJ+cuarq0XINTUHDojZ1200QGctnX2s=; b=SUl+ss9v5UYWv8NVc+1bIneBIoOFhC93EyGiZTsCfA+JgqnMTLsUJhloNmitcDPyah zhSiml1PTBGgW/R81AmM8CTk6Sj107GDnZP+DAs2hC79RVmKywEOAQw+7F97t87n5cb/ 3SNTvvcC2eb61GOiCXqztxc82x8jzbFrDdEn2F+X6XmhlCMNavxIn5Jx3//Xss8BFX9y 8IZv9wIxrUFj4shJIPlq8ONgV0y93Ww0E/IRPe+0kwCfnhC/ue90egwnnvkSpBl36z6T ggsXtcw+ss/53rVrtqvTPDTvvwDTGVjAShKJ752MLUXrcN0ksnOd9hhHEYWgFG4uUZE1 1+pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fO35H2/wXICWhJ+cuarq0XINTUHDojZ1200QGctnX2s=; b=ALDzzQQQ65gEdIM+Irwb5UmVjK/wpoBAIUnZmJIkcb+wT7tVTxCaVvQCG28ztJzsFj 1W/KSJRcgaMwbcvEReY9liyzdDVZTnXgQEVRQreGhai8/84rSrDRSGHoBkHghG60lx0h 2RluuGjMZl5x9FKN7zD6KLd7/BeqOvTBvdyW8BTG5bMt5s7EhRmJOHZHiDs+aAi/aIY7 IzPPQK0X8cc6iJGNSUGQ3tTjdOdg/N70rTvMPeSZjREm/6w+Rl7nbaT57ssaXuft92rM 6uPqglyViXId0GOsHZa8+wAqFRYKRfGRB9w4A9rOGB+znkh9LwZx7Mgg+IbOEUtv8BcC MoFw== X-Gm-Message-State: AO0yUKUIlHv7De7aM5Td+kfcC7d+wizvaIDcYZUzNRU7RtIqBCaBp9Ff uMiVjyu9LfrHZeLbbGVxAx2rhj4/B5d+KQ== X-Received: by 2002:a17:907:e8e:b0:878:7ba6:b69 with SMTP id ho14-20020a1709070e8e00b008787ba60b69mr8224743ejc.51.1675264102547; Wed, 01 Feb 2023 07:08:22 -0800 (PST) Received: from pc638.lan ([155.137.26.201]) by smtp.gmail.com with ESMTPSA id qc26-20020a170906d8ba00b008787e94c5ccsm9585774ejb.184.2023.02.01.07.08.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 07:08:22 -0800 (PST) From: "Uladzislau Rezki (Sony)" To: LKML , RCU , "Paul E . McKenney" Cc: Uladzislau Rezki , Oleksiy Avramchenko , Jens Axboe , Philipp Reisner , Bryan Tan , Steven Rostedt , Eric Dumazet , Bob Pearson , Ariel Levkovich , Theodore Ts'o , Julian Anastasov Subject: [PATCH 05/13] lib/test_vmalloc.c: Rename kvfree_rcu() to kvfree_rcu_mightsleep() Date: Wed, 1 Feb 2023 16:08:11 +0100 Message-Id: <20230201150815.409582-6-urezki@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230201150815.409582-1-urezki@gmail.com> References: <20230201150815.409582-1-urezki@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756642124967204952?= X-GMAIL-MSGID: =?utf-8?q?1756642124967204952?= The kvfree_rcu()'s single argument name is deprecated therefore rename it to kvfree_rcu_mightsleep() variant. The goal is explicitly underline that it is for sleepable contexts. Signed-off-by: Uladzislau Rezki (Sony) --- lib/test_vmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/test_vmalloc.c b/lib/test_vmalloc.c index f90d2c27675b..6d8c5c0afd53 100644 --- a/lib/test_vmalloc.c +++ b/lib/test_vmalloc.c @@ -328,7 +328,7 @@ kvfree_rcu_1_arg_vmalloc_test(void) return -1; p->array[0] = 'a'; - kvfree_rcu(p); + kvfree_rcu_mightsleep(p); } return 0; From patchwork Wed Feb 1 15:08:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 51400 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp334417wrn; Wed, 1 Feb 2023 07:14:33 -0800 (PST) X-Google-Smtp-Source: AK7set9ygD7BFTLY3HWZKAu4eEWykAh9D4USjNacaSNAHIqFz9JKUGCwhkXK+/+uHK+zPaSAUwE8 X-Received: by 2002:a17:90b:224e:b0:22c:79bf:bee1 with SMTP id hk14-20020a17090b224e00b0022c79bfbee1mr2815481pjb.10.1675264472655; Wed, 01 Feb 2023 07:14:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675264472; cv=none; d=google.com; s=arc-20160816; b=Q+Zs0s7Mtr1yHI9hqb2jn+EfcjCoLb+paPTHL59NJwN9tsSwaQgkKkDt583AMbNCmH jI+q7tGVe0a2zrdwkGt6qyc5+CQJqw9pix9l/TBbmE2u8TWqe4tSc2gAbWfp9mp72vH3 EZGqgLjGVaRiEzkjx8YYPUBK+qAMpxYw1QuFcRrBvvJJTgKNjxFAAfx7owgPEdf+DtWV DBDdcWt1r0alcmTK7EDt/fKgyKwe8aXx6alvGGl/bdjl8UcM1Wd2sh75DIzzFCAniRQ/ KFuLzNHayp1PVHxhupP9a4RjjhmbnMjpJSC2TG9KtnchxGXsV5z8pCPvES19+EqBvPqc qI0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=v7t+jH47dutnrEewrpFYJCTIdzeIdrMXC7jVe2cYM1o=; b=zUoeTqKwvYhq1W254QCcE+yQtnH7D5Eqiqzp1UmnH1lL5Vcj0Zub9sDSWOKPqcqHAB +uEG7MBKST9Eq5c8xm05o3fAOTJh4WnPCLGzFH8McKR8sOMuc9zukThWIoaM+wDS5BPD DS/2w/Fyy0d5rJEdxopQ8KorGn/MX2EDho7Rp4sur1bICOaRTXH7htQsG5fH9UvBqBPf 3HdCdGxSZ5hmmMqPp2ECCbkAwnbVHhJHdYXmNgD80cHebb+tgldVg5RUy4a+xbt8rsbL ZtS1b8XsCc2XCUavzGgrUGP60ltRbkpx3xBuX7A/z/FQn7rMni6pOne6y7skxR2aw13T 1/1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=axm8GclN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cx14-20020a17090afd8e00b0022998c014c1si1882727pjb.51.2023.02.01.07.14.20; Wed, 01 Feb 2023 07:14:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=axm8GclN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232755AbjBAPKo (ORCPT + 99 others); Wed, 1 Feb 2023 10:10:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232926AbjBAPJo (ORCPT ); Wed, 1 Feb 2023 10:09:44 -0500 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D10D66FAA; Wed, 1 Feb 2023 07:08:24 -0800 (PST) Received: by mail-ed1-x52c.google.com with SMTP id be12so6740712edb.4; Wed, 01 Feb 2023 07:08:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=v7t+jH47dutnrEewrpFYJCTIdzeIdrMXC7jVe2cYM1o=; b=axm8GclNe0TkydqMsP7WrJXjtkaTy5Us4zqhdTWmg2xnNAxQfkDMBXKZ21FQxDg7wq FxoE3ayhhjkVGUy//ctSzLPp9/7i90nBwEV3YVUJJ0WMFS5L6oS0suOeNLJeaVO6i2L1 s8s1dW3g8daDhCb1PYPRpk8S/774DEKn4IyUIiponWkVWmreuGMAosaw3IWCdhuPdVJ8 8SEmr6Njxvw8bB5KOqp0GY5Gf1rr39JDlnVXdQhY5fpbEobkXyahDU92E1S1lU+xpoNd 3O2/LiEs1exrkzevNNQX25oi7cq7VW5YiMd/AJcDfnHEF6LmMvNaI6AoTi/gRVb08UPH eGiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=v7t+jH47dutnrEewrpFYJCTIdzeIdrMXC7jVe2cYM1o=; b=NI9Ja2nuJ+5Tp+JCstwRgvTPLm6oTRrOpBn2JmE998ZfjHJdFIt8BWz4NZgWENpjE/ 4qHYAMtLrK5yKxJEfw5h7cvp21MM7hhr/MtIZvdrKJOsp0iVzrdAWCHx/HnsuwL5PM7t 4j1rWRf8NNMb854cnRav8G/BpLGomYo50OuysonC7oKXXnMmcRX85or6cGmUbIUeybE1 sn0ClclF2IWn1AFzqgdGknwx8sDpLTNNZxr/BVyd2UfgsMfmDLgIFCt3gvRD+g6ZaZ9P 9dMYTQ/NuaOCMAOikNGjKpMeNjuZL34dhcNUGmWzNMDjpw97DXffULUu+VELMi0x19tx InEw== X-Gm-Message-State: AO0yUKXoUGJPQARKOPL3OieET0t74kawstx8y6Vt0WMK66gldvCwQwm6 ByLLbcw1Uugpwa5+FIglVKox8v912bTJ/Q== X-Received: by 2002:a05:6402:3488:b0:494:fae3:c0df with SMTP id v8-20020a056402348800b00494fae3c0dfmr2985034edc.12.1675264103466; Wed, 01 Feb 2023 07:08:23 -0800 (PST) Received: from pc638.lan ([155.137.26.201]) by smtp.gmail.com with ESMTPSA id qc26-20020a170906d8ba00b008787e94c5ccsm9585774ejb.184.2023.02.01.07.08.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 07:08:23 -0800 (PST) From: "Uladzislau Rezki (Sony)" To: LKML , RCU , "Paul E . McKenney" Cc: Uladzislau Rezki , Oleksiy Avramchenko , Jens Axboe , Philipp Reisner , Bryan Tan , Steven Rostedt , Eric Dumazet , Bob Pearson , Ariel Levkovich , Theodore Ts'o , Julian Anastasov , "David S . Miller" Subject: [PATCH 06/13] net/sysctl: Rename kvfree_rcu() to kvfree_rcu_mightsleep() Date: Wed, 1 Feb 2023 16:08:12 +0100 Message-Id: <20230201150815.409582-7-urezki@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230201150815.409582-1-urezki@gmail.com> References: <20230201150815.409582-1-urezki@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756642119723903023?= X-GMAIL-MSGID: =?utf-8?q?1756642119723903023?= The kvfree_rcu()'s single argument name is deprecated therefore rename it to kvfree_rcu_mightsleep() variant. The goal is explicitly underline that it is for sleepable contexts. Cc: Eric Dumazet Cc: David S. Miller Signed-off-by: Uladzislau Rezki (Sony) --- net/core/sysctl_net_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c index 5b1ce656baa1..a28562d4e468 100644 --- a/net/core/sysctl_net_core.c +++ b/net/core/sysctl_net_core.c @@ -101,7 +101,7 @@ static int rps_sock_flow_sysctl(struct ctl_table *table, int write, if (orig_sock_table) { static_branch_dec(&rps_needed); static_branch_dec(&rfs_needed); - kvfree_rcu(orig_sock_table); + kvfree_rcu_mightsleep(orig_sock_table); } } } @@ -139,7 +139,7 @@ static int flow_limit_cpu_sysctl(struct ctl_table *table, int write, lockdep_is_held(&flow_limit_update_mutex)); if (cur && !cpumask_test_cpu(i, mask)) { RCU_INIT_POINTER(sd->flow_limit, NULL); - kfree_rcu(cur); + kfree_rcu_mightsleep(cur); } else if (!cur && cpumask_test_cpu(i, mask)) { cur = kzalloc_node(len, GFP_KERNEL, cpu_to_node(i)); From patchwork Wed Feb 1 15:08:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 51405 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp334720wrn; Wed, 1 Feb 2023 07:15:00 -0800 (PST) X-Google-Smtp-Source: AK7set9DMIa4JwF5cyaQjXcuTShM521Y3QpAgpumddSB88kpVne1iJ1z60Bz7NrsQiCbmtQPPlTR X-Received: by 2002:a17:90b:3e82:b0:229:4731:994d with SMTP id rj2-20020a17090b3e8200b002294731994dmr2678544pjb.4.1675264500143; Wed, 01 Feb 2023 07:15:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675264500; cv=none; d=google.com; s=arc-20160816; b=S3jwOhtsMxNpQr4dhM8Ne2EXFGpUs/1Svya4kN2QDqjVV9htQDmNmh/6Uft96T+9Yn wHlgOZlxntMdf46uNWVmP3Ru9XSRkNnVFnJtTERjVhCrRNi0HxQkIJr1nFHAP24X5iWF dPhVhVRnc6UPM2Hyd5VRsRx05c0hHMC1rL/qrBXzZrW4BFCixx9FIFv72fWYcZ/B7z0S ILyPoysONUSDYTWTz6kkSlIpCgKrBSAz7LS2ekRcPzoCVGBT08O9+Gf/lIwO1wZpOJey j1ugkfUSt+W5TYMR4eRWmN0sZ/cQ0Gl0vApSgS7jHIocBWt6vP4P2zoeDGZ864GyoD6L Fj6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JmKlyMMJ/xEGlFGd5Gxv5AeF+U+6+mZ4G3QkqKY1mdM=; b=A9R3w3YQQlYrhEXL8BIxnR+F7/wo5Niq+RrL/dSGywsOVsmRCPy0bYXCSc5ooLy0HJ 8kE7AkRtBXu3mpgFSwXN8W6T14ahtgfgCMaGrZXcjSOjlbYPH9c3ldK0y7XXBULE0tSI 9JXrcH5plzYorqXzVztcG4vcOrHg6Hvmefc/V7iXTmmelyejS7NpqMNa8zqjBI44EVVQ qLYd189Vg/Ggnf9znx2waEGv1OJMPT1y6N/K//eD9B6nhvZacvt0frlRKWIo0E5BInmF W/zISIKpIF2NFG4BsCB3yzWsT+WNvBMgYoTH+XI9bmj31Q9Hk+H35pM4Q55cdsF6Unez vSfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=c6azTpWk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p18-20020a63b812000000b004ce7eecf595si17850325pge.281.2023.02.01.07.14.47; Wed, 01 Feb 2023 07:15:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=c6azTpWk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232040AbjBAPKt (ORCPT + 99 others); Wed, 1 Feb 2023 10:10:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232922AbjBAPJo (ORCPT ); Wed, 1 Feb 2023 10:09:44 -0500 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2018969532; Wed, 1 Feb 2023 07:08:26 -0800 (PST) Received: by mail-ej1-x62f.google.com with SMTP id hx15so32760401ejc.11; Wed, 01 Feb 2023 07:08:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JmKlyMMJ/xEGlFGd5Gxv5AeF+U+6+mZ4G3QkqKY1mdM=; b=c6azTpWkKQffBEe2MAEiXW7H64r7G8RxpP6AOHcPVZdNMYkjx+JYt3ZJrwoey7Bhi4 3U5CZt8416awlbOmwyyXDpO4v9virbiJVJJ6QAT0nXMsCHWYFUBDwFiZipY6eNuE4zWB ZRQrhMcnthZ5uwrMZCRpHftZzckhjKVjf1N1UrgJcg4ZitsN+YtuToG35yrOwioAWtNw EPhjUTGd2kUwpjHBOlh5TAL1SbRX6ezF05RUFgd0l9zrrRWxU1sJvo7LM9lQTOWCljrx LnLmy+g4GWsbSBU9Ph/CEfX9TR82hOo4TOwOX4YqqT39urmQ0JKYNLdFMEdiCthvc3O3 oSKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JmKlyMMJ/xEGlFGd5Gxv5AeF+U+6+mZ4G3QkqKY1mdM=; b=bvSnPIkDHLQVHQCV7IgZAS5qdkO4qWHmUMU/EF5PJXOFvjJ037CUodOFfhWf+XFNjp bpEloCSGfIXal9sNlTIEAJoI2w12J7OkTMv9u1dJcNwblTgEnGpH2kPleu2D7CM2khLc S49nIM/P6tJnDGQcpQ7s4uwk3lDllV0TioUpb2rR5EZK9lPhONssPbUzv+glbIhr6u1V GBkeqkZSQpAOdBwgL3jowiG4RVrG/Et84313cqXIvCivQ3ERfpvDzlEngp0tSzgKP/5o CguCdV+RYRLdgijNc0uvpbO03gCQ74/+Ee7h7o5RUv2LpRAMP+NILHAIWMRbY1GAqoVz ItnA== X-Gm-Message-State: AO0yUKXITv0377hAamF7toC9r3bGX3VVPUZxUh8hbb0AeBT132tfSFDv y7wLON/TPLZqhMzAmU84i17uDa9XmUKZEw== X-Received: by 2002:a17:906:fc13:b0:87f:d08:1064 with SMTP id ov19-20020a170906fc1300b0087f0d081064mr6012611ejb.6.1675264104460; Wed, 01 Feb 2023 07:08:24 -0800 (PST) Received: from pc638.lan ([155.137.26.201]) by smtp.gmail.com with ESMTPSA id qc26-20020a170906d8ba00b008787e94c5ccsm9585774ejb.184.2023.02.01.07.08.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 07:08:24 -0800 (PST) From: "Uladzislau Rezki (Sony)" To: LKML , RCU , "Paul E . McKenney" Cc: Uladzislau Rezki , Oleksiy Avramchenko , Jens Axboe , Philipp Reisner , Bryan Tan , Steven Rostedt , Eric Dumazet , Bob Pearson , Ariel Levkovich , Theodore Ts'o , Julian Anastasov , Jason Gunthorpe Subject: [PATCH 07/13] RDMA/rxe: Rename kfree_rcu() to kfree_rcu_mightsleep() Date: Wed, 1 Feb 2023 16:08:13 +0100 Message-Id: <20230201150815.409582-8-urezki@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230201150815.409582-1-urezki@gmail.com> References: <20230201150815.409582-1-urezki@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756642148439332957?= X-GMAIL-MSGID: =?utf-8?q?1756642148439332957?= The kfree_rcu()'s single argument name is deprecated therefore rename it to kfree_rcu_mightsleep() variant. The goal is explicitly underline that it is for sleepable contexts. Please check the RXE driver in a way that a single argument can be used. Briefly looking at it and rcu_head should be embed to free an obj over RCU-core. The context might be atomic. Cc: Bob Pearson Cc: Jason Gunthorpe Signed-off-by: Uladzislau Rezki (Sony) Reviewed-by: Bob Pearson Acked-by: Zhu Yanjun Acked-by: Zhu Yanjun Reviewed-by: Bob Pearson Reviewed-by: Paul E. McKenney Signed-off-by: Joel Fernandes (Google) --- drivers/infiniband/sw/rxe/rxe_pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/sw/rxe/rxe_pool.c b/drivers/infiniband/sw/rxe/rxe_pool.c index f50620f5a0a1..e2fa061f19b3 100644 --- a/drivers/infiniband/sw/rxe/rxe_pool.c +++ b/drivers/infiniband/sw/rxe/rxe_pool.c @@ -276,7 +276,7 @@ int __rxe_cleanup(struct rxe_pool_elem *elem, bool sleepable) pool->cleanup(elem); if (pool->type == RXE_TYPE_MR) - kfree_rcu(elem->obj); + kfree_rcu_mightsleep(elem->obj); atomic_dec(&pool->num_elem); From patchwork Wed Feb 1 15:08:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 51396 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp333608wrn; Wed, 1 Feb 2023 07:13:19 -0800 (PST) X-Google-Smtp-Source: AK7set9BU+2J/oFaHcCwqQIONLLtwJ0cFIIzcVWawDE7y3BIU3PwpvZSYITUhmf3Qnw9p/riVzU9 X-Received: by 2002:a17:903:2345:b0:198:a338:b9c5 with SMTP id c5-20020a170903234500b00198a338b9c5mr3956483plh.2.1675264399532; Wed, 01 Feb 2023 07:13:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675264399; cv=none; d=google.com; s=arc-20160816; b=EfS3z8VGrYsmLYkBPAj95m7ndsiDevjpK7w7/j+6ajLkPoC+4Iw7p78fMBwP6gN6V8 h8gC4awbBNhBWP7zMS3C47W9drQ/uaW2Z7siraC/ZSbt9ieNpyA4f5OGQvmJGv98zERs e/75KbYP5OosQG4EIxxQaH43gYFy4KCC4+txr4AFh9Yo7mZAFMs2TGYExwmkSIVjVn84 4z51zH4g2caxFurXv/w63z0QmSmEEkLzWKcABcPlJEDIoc2xRjwdCHcihRqal8HMfZ4v mCTnjJRCYJSOskm9af5tSn+4u7YiIAJbdc9Hh9mWrvPjhSZEZmn552TRuKicw/YAyUQe feUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Rp5plCaK+Ee0v6zJJSPg3nVKcz7Ocb0iI+K21w1Y4qU=; b=UNrKB2SC2wE7f3Hrgeg4DCuahZEHB9+Wx2AOVrFACnhGrjxjroTho8VjBu1jTYUaOp bM0N7LZ4bnkiolja9Zxx2zaZDLkoBv4kBRz18OZ/tjHT/o18nvjrJ1hmh5Bbrrcj17NA 1EgUVup4RB3h66+ew30ayM3txL8cAQl0sZNSH6jBERjNcYIxUAUe3iEHLQMwopEuHdMC QCMBj2L3QhVS5cgvE1EmdrDXs2KVwLRjAfrwDs7ZGoNflaPWIIO40qDCi24cC/3syd9m 0JcC+0yD8Msd326fK4QvupTxmKBDvCXQjJX7bdUCiJ4HeU+KqbeD6o051mUGcxgdjuZJ iKlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NRcPeMqB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e6-20020a17090301c600b00194a0da96a5si22199782plh.170.2023.02.01.07.13.02; Wed, 01 Feb 2023 07:13:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NRcPeMqB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231921AbjBAPK2 (ORCPT + 99 others); Wed, 1 Feb 2023 10:10:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232755AbjBAPJr (ORCPT ); Wed, 1 Feb 2023 10:09:47 -0500 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3940069B26; Wed, 1 Feb 2023 07:08:26 -0800 (PST) Received: by mail-ej1-x62a.google.com with SMTP id lu11so14978562ejb.3; Wed, 01 Feb 2023 07:08:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Rp5plCaK+Ee0v6zJJSPg3nVKcz7Ocb0iI+K21w1Y4qU=; b=NRcPeMqBEWHBNfeM1QbytTGZ1tgUxGV947jrBR4ORmkwM2cjGj3VYO0Izn3sEkPeze TDSUaTP5zxyGloM9o75uwKb/ZyZk+fFS41eEBX/ap94gmlod2QhZDMBcdzZ+T6SWJIxm xuFMcqYWNXTFaAXiqxSzjvITMIqrA3UicyA6oKp7NZlv1V6pLdXCS4ya609Bdnz2D9Hi b9YuqWqFWdwJuTWGcraM1KZR1fSnQ3h7rueNOAopZZIlBcNIbA5q/QflEcWfVU8VhwXZ LsM4DihK15XNeSKhFz6YbZWMfSSGuU6F0Wy8Oq6rqwFlvmWH50agLQkQB+J8MR8Y3z3k S12Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Rp5plCaK+Ee0v6zJJSPg3nVKcz7Ocb0iI+K21w1Y4qU=; b=yQceJNKmuBB00xxZzAR1uTlwZUQY1IdE2Jv98ijCpejFbtBFUO6pg5dk85r0PcAf+/ 4bcfFzPI/tEGGzznpvOSAzUrCx6rxWpQdsm+opSod3HmEmANTmBrD6PuE+3tWdhixLVl qENeAPcP3CB12jr7Mrz4lxVVe+W6YASy3KhUxXLvJbqk0zxk6oE1ml2YLjZsXBTYTFT+ hvSDs76UX4Gm4LbVRhOXaBh74v8mD6s4mTZXha9eEBb/5YffS2xD3g6R9PSx4q4ZrOXR NaQR0ZvWOtCV7gEJu4tAfBfkbJfzNusZwDD6v4yAxqKfg0M/pAvLQ6SrsQlg6EWNjeh4 6KnQ== X-Gm-Message-State: AO0yUKUnvqqw4FPA1lTMPE0zxU09pbIuNUBeO/hwZzQvI5IZ64F+cG6q r7YrfcgGuNlh3LXmZ2wuY6CipJWiFglyrw== X-Received: by 2002:a17:907:98f9:b0:87b:db62:d659 with SMTP id ke25-20020a17090798f900b0087bdb62d659mr3026308ejc.19.1675264105400; Wed, 01 Feb 2023 07:08:25 -0800 (PST) Received: from pc638.lan ([155.137.26.201]) by smtp.gmail.com with ESMTPSA id qc26-20020a170906d8ba00b008787e94c5ccsm9585774ejb.184.2023.02.01.07.08.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 07:08:25 -0800 (PST) From: "Uladzislau Rezki (Sony)" To: LKML , RCU , "Paul E . McKenney" Cc: Uladzislau Rezki , Oleksiy Avramchenko , Jens Axboe , Philipp Reisner , Bryan Tan , Steven Rostedt , Eric Dumazet , Bob Pearson , Ariel Levkovich , Theodore Ts'o , Julian Anastasov , Saeed Mahameed , Vlad Buslov Subject: [PATCH 08/13] net/mlx5: Rename kfree_rcu() to kfree_rcu_mightsleep() Date: Wed, 1 Feb 2023 16:08:14 +0100 Message-Id: <20230201150815.409582-9-urezki@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230201150815.409582-1-urezki@gmail.com> References: <20230201150815.409582-1-urezki@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756642043337571721?= X-GMAIL-MSGID: =?utf-8?q?1756642043337571721?= The kfree_rcu()'s single argument name is deprecated therefore rename it to kfree_rcu_mightsleep() variant. The goal is explicitly underline that it is for sleepable contexts. Cc: Ariel Levkovich Cc: Saeed Mahameed Cc: Vlad Buslov Signed-off-by: Uladzislau Rezki (Sony) --- drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c index ca834bbcb44f..8afcec0c5d3c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c @@ -242,7 +242,7 @@ mlx5e_int_port_remove(struct mlx5e_tc_int_port_priv *priv, mlx5_del_flow_rules(int_port->rx_rule); mapping_remove(ctx, int_port->mapping); mlx5e_int_port_metadata_free(priv, int_port->match_metadata); - kfree_rcu(int_port); + kfree_rcu_mightsleep(int_port); priv->num_ports--; } diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c index 9369a580743e..5d32a8a5e5a4 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c @@ -672,7 +672,7 @@ static int mlx5e_macsec_del_txsa(struct macsec_context *ctx) mlx5e_macsec_cleanup_sa(macsec, tx_sa, true); mlx5_destroy_encryption_key(macsec->mdev, tx_sa->enc_key_id); - kfree_rcu(tx_sa); + kfree_rcu_mightsleep(tx_sa); macsec_device->tx_sa[assoc_num] = NULL; out: @@ -851,7 +851,7 @@ static void macsec_del_rxsc_ctx(struct mlx5e_macsec *macsec, struct mlx5e_macsec xa_erase(&macsec->sc_xarray, rx_sc->sc_xarray_element->fs_id); metadata_dst_free(rx_sc->md_dst); kfree(rx_sc->sc_xarray_element); - kfree_rcu(rx_sc); + kfree_rcu_mightsleep(rx_sc); } static int mlx5e_macsec_del_rxsc(struct macsec_context *ctx) From patchwork Wed Feb 1 15:08:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 51398 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp334267wrn; Wed, 1 Feb 2023 07:14:21 -0800 (PST) X-Google-Smtp-Source: AK7set+Yd7rcJIkF5g8IUsx2e4UIMXiFk3fVYUwtSm0bhqkYZvBoDN/Iv9eqLLMhduc/zE2Ej28H X-Received: by 2002:a17:90a:199e:b0:22c:978e:8a6d with SMTP id 30-20020a17090a199e00b0022c978e8a6dmr2624962pji.33.1675264461369; Wed, 01 Feb 2023 07:14:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675264461; cv=none; d=google.com; s=arc-20160816; b=l0JxrizGsVWi0M53L4m151TbsHwZZbXbbwqebqwz8Of/pX+4qGt8VKKfiKHMCfeLNq xcJ92BXcxRcNwxH57hutVb2ufQY8IDW6UApiZLluDHH6vSE6EHqLLeppUjqWxLmrAPAe AqCuAC7ZqOjClojwEyzIiv50uFB9DGEABkMvr0npTdnSvSZsNd/atpklCqb4bzHAg47u zX8711D8TuwAJO4BToR1TevKixjdYMu99iY7qcGh7a0CLrrPEr0WdqdI2VfvYWvAe55Q wnVHMYABlMXZDNYGFSlU4Er9uQMaOgjnzBv7UTdNF8F8LZOhciyslfwDfKTK+BWQGBxs vFlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=aCIsnGFwfhB3GdHRBSUurOPmrL4KoA1jNcMHDebxURA=; b=ApOt9sm31ADghA3ZZSFNrTYyMqa27u6gm2sJxJ8+H9PofS0AHpjMIrDEINw+oDJpkS BAbIPYTcnI+Do9M80n6M6jNc9j2MGdPOrskqssYkh130XiG4hiuM1FryDchkr/7MbZLj D9E9a3H6MFPAc2xbrxayU56FKBMP0U94W27YDNuyKBaiFGCnOTTMtdmT5FpMrKDv+ZR8 7pQWIciM0f5kbNCS//vu3nCHp50L+GSYrXvkPH3YyMOpDSPHhuu28z/lOSy6fNS+RiGA 7clyKnDVrlitliJVkme5vrcDRiwXk7vtaMmRGTEZeqyzchArJzVn3yyqY1FYL6rJzrf3 mT4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BoPO7gpL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l16-20020a17090ac59000b002262476fc44si1770859pjt.178.2023.02.01.07.14.08; Wed, 01 Feb 2023 07:14:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BoPO7gpL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232732AbjBAPKk (ORCPT + 99 others); Wed, 1 Feb 2023 10:10:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230417AbjBAPJo (ORCPT ); Wed, 1 Feb 2023 10:09:44 -0500 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 445BE6BBC1; Wed, 1 Feb 2023 07:08:28 -0800 (PST) Received: by mail-ej1-x631.google.com with SMTP id dr8so30717619ejc.12; Wed, 01 Feb 2023 07:08:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aCIsnGFwfhB3GdHRBSUurOPmrL4KoA1jNcMHDebxURA=; b=BoPO7gpLDoTuKhel0GzrIKGVr1TL37RGWdatMkKU0QJJY+2/5Q79vJ3ju3SNEP0hUi pS4R4XFaydaMFuGZ1BHFw2bOiaHCZz6cImmmpdB9bnx7OCWudj9X1EkAa8hpCqiDHkvc AXrztKeyxki0DyD7ogtOJXKnVZVw9gTLmZsrB71UvG2iScNVZ1fkXsxG7PoYXaaI38oE v8yTaTAe3z5sHYG7e/DL76rJRpPUCm6D5cH2rmKbyMa/oiQ9H+QJ3tfX+YGKRZRXqv31 40m4gkFYfLThinnJF9d22bciAQBsclWsv27RAzxjq5qL8dNOk3NXmRxTNxF1pPv81S2j LGgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aCIsnGFwfhB3GdHRBSUurOPmrL4KoA1jNcMHDebxURA=; b=NH+oMjMNt8Y1lTUwXK3Kfr2jYif8DPhrd5IZv5w70ys9DT26WIeJ5rB01AOjibvSFI +TZlEddBS/hOoEMoz4GSnSiR3u3MuXIgjIdB9zP/EivmpCTPMg4ZzW3Pde9zGOuOpbA5 lFXuTpjzC/koN6jta1acP2DeANYgnivZxrj60zGmUtfwxie5FUYo7K9UicBo7y3KC/GU TZt+DNCuUa35PM7vhnCUAAyZM6rZi3hDYDHlZ8S3EPE+OgVhGagw8wcww7Ve/HYL70Iz +GdwcgAIQq33Xa35WmAXQQmVhaIekNe41gzfA38N+K9I4IgGbEyqf/TRCWgzm8yekivF bekQ== X-Gm-Message-State: AO0yUKWhbkLqVPv9H21eZAICnqaDYrznvHfU6OSO5eugEnavzb/cqvzW +dYDdboAMeBwN/OThAwwjHSDRsXRA0meYg== X-Received: by 2002:a17:906:1441:b0:870:d15a:c2dc with SMTP id q1-20020a170906144100b00870d15ac2dcmr2800269ejc.74.1675264106371; Wed, 01 Feb 2023 07:08:26 -0800 (PST) Received: from pc638.lan ([155.137.26.201]) by smtp.gmail.com with ESMTPSA id qc26-20020a170906d8ba00b008787e94c5ccsm9585774ejb.184.2023.02.01.07.08.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 07:08:26 -0800 (PST) From: "Uladzislau Rezki (Sony)" To: LKML , RCU , "Paul E . McKenney" Cc: Uladzislau Rezki , Oleksiy Avramchenko , Jens Axboe , Philipp Reisner , Bryan Tan , Steven Rostedt , Eric Dumazet , Bob Pearson , Ariel Levkovich , Theodore Ts'o , Julian Anastasov , Lukas Czerner Subject: [PATCH 09/13] ext4/super: Rename kfree_rcu() to kfree_rcu_mightsleep() Date: Wed, 1 Feb 2023 16:08:15 +0100 Message-Id: <20230201150815.409582-10-urezki@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230201150815.409582-1-urezki@gmail.com> References: <20230201150815.409582-1-urezki@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756642107829659824?= X-GMAIL-MSGID: =?utf-8?q?1756642107829659824?= The kfree_rcu()'s single argument name is deprecated therefore rename it to kfree_rcu_mightsleep() variant. The goal is explicitly underline that it is for sleepable contexts. Cc: Theodore Ts'o Cc: Lukas Czerner Signed-off-by: Uladzislau Rezki (Sony) --- fs/ext4/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 260c1b3e3ef2..87aa23d047c9 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -2500,7 +2500,7 @@ static void ext4_apply_quota_options(struct fs_context *fc, qname = rcu_replace_pointer(sbi->s_qf_names[i], qname, lockdep_is_held(&sb->s_umount)); if (qname) - kfree_rcu(qname); + kfree_rcu_mightsleep(qname); } } From patchwork Wed Feb 1 15:09:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 51404 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp334691wrn; Wed, 1 Feb 2023 07:14:57 -0800 (PST) X-Google-Smtp-Source: AK7set8fBkSFnUTJ2XxuZdIK9jBgtcrMRmtVT1j3VrKy2dwS7gnR2TXDJM+0du287SMa3HoKd703 X-Received: by 2002:a17:90b:3e89:b0:22c:1119:d7f1 with SMTP id rj9-20020a17090b3e8900b0022c1119d7f1mr2736179pjb.7.1675264496933; Wed, 01 Feb 2023 07:14:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675264496; cv=none; d=google.com; s=arc-20160816; b=NzROflpFBkVTZnOHmsU8JXmOzkz6Pqqw2lZSb+5aYTK+Ewqn8p11zyVbYBQYruAmsz XQ6FILmo8ueJL6ohWxQF+T+nYh7UqKDxkbXmH1mWkUxmlW0WG/U08AthjVoKZVAivtBA ePtlr/icwiVgBKolOEit94WmRnRheNLUH38bDKXvTjz9ZU1OeuAA7GoVReDrN1WvWz5H Pg0gFNrleFhiuIGswMu09N9pEaka4ScULuw/PlIlkOAVO2/Fe8NepZ+LxGqRop/ZfxTs VK6ygfBZ+uHaT2HnKAsgV9wc+YIwFMVRVln12Cw/bb8UebtuY3UynHGj/0/5N5XEO3Gn p3kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=tXjIjq2OSXfc4jMxvXeb0r5u9dXZ/7er9tkJEls7xtk=; b=vkWJxuCJ9Xx59PT58HsKbCPTqpNTL3gGxSSzS1Vp0KuNARLPn1DSnFYMlxmvJIV/KC lRq+IHAgolFQ59zhwkVLWOSCg3CPG5GfL8O+3f3KeeJW2RdGeaDsdL9gTZIFBhqt5NlX DZCeSALdRWBhiPpqg5buisZ7mlhJgjR0UsAZdo7zXgb7CQCFVBpNyLLj+gSRkITDSLF2 Zjr1a58kintzKETopIUoldhIyqjMt3vwTS6CUC3ZR1TZOHra1JwTCt1celr1y/hu4/eh GKcKHP+J8+g+QxN9FKhslN2b/SwWQdk691xPQLgbByrHaxpSorq/567nV6q1ePZJGIC3 gNXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dtAAXAU6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ml17-20020a17090b361100b0022bb9fc4c37si1917215pjb.77.2023.02.01.07.14.44; Wed, 01 Feb 2023 07:14:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dtAAXAU6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232259AbjBAPLa (ORCPT + 99 others); Wed, 1 Feb 2023 10:11:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231941AbjBAPK2 (ORCPT ); Wed, 1 Feb 2023 10:10:28 -0500 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 280404ED8; Wed, 1 Feb 2023 07:09:58 -0800 (PST) Received: by mail-ej1-x635.google.com with SMTP id ud5so52337941ejc.4; Wed, 01 Feb 2023 07:09:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=tXjIjq2OSXfc4jMxvXeb0r5u9dXZ/7er9tkJEls7xtk=; b=dtAAXAU6c2GAjbfjuGt79DK/CapzQBC0LdPCjOljsN234iuNoqxq+8rLsfL4+e/xEc HHFxJiHO4FLJHKUjjwLXg8itxMnrV1A1tPgmsn6Inmo6jycPqiBchRgNFPEHCKsrNagm bGI720X9uAaxXmY9AxKu+3t37E39DghKxenJf0lnWnFNgwS6aAegPpZtj5yv2pLpb4pQ /dIWhNeT+qZQEaxLyN6n2jiYGoxisBbjwV2yoX7MELz4Fzliy8IylETDwklv8aWRvBig yHqWk1FAvEZRpw6bfDSk7uukFjh8QwAh27xxtPmineQ5fZ80bTCxBK2xq8f9ZyrNEWld JVqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tXjIjq2OSXfc4jMxvXeb0r5u9dXZ/7er9tkJEls7xtk=; b=4vSF9SCjqtNJxIj5peijHXYBDftG+BYomOK4RLvL5uLTEjBOvTADI05hRugXDekm5B ZIuVmi90zpXnN2wezQYB4CULrL+oWf/k5BbZa3p8ZByfOmc4rK3gIo68hrD6klUVO3VC IqkTS5QPVFAIkZQ+FXp8RAXkzUlWpmIIJOmhE2xi+Qh/EFwBrxHgIAAygO4jfNXlnIaJ aDYacbIJdLMn/2VZcLKGu2ZLMhQwQ8xfW7+0YDU5Bd/BAMdPZytKQNSCJrJ1bseRKC9o SEwOkc8JnfoKtTDmcy/zMybJEDxjk9v13Pzow6gYQ6pqiLrtd9nsyUyqX2F6pT7zKAcI TV6w== X-Gm-Message-State: AO0yUKUOobXbMvfHrQT5KNK52b4p+fDz7ntdVi+YxR2ISFFi0pEWMi7W AF0MkmxTtvdCCOBL6GCyKQdLi6tHOXHKbw== X-Received: by 2002:a17:907:1c27:b0:84c:e9c4:5751 with SMTP id nc39-20020a1709071c2700b0084ce9c45751mr2617987ejc.74.1675264196706; Wed, 01 Feb 2023 07:09:56 -0800 (PST) Received: from pc638.lan ([155.137.26.201]) by smtp.gmail.com with ESMTPSA id fe15-20020a1709072a4f00b008845c668408sm6627147ejc.169.2023.02.01.07.09.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 07:09:56 -0800 (PST) From: "Uladzislau Rezki (Sony)" To: LKML , RCU , "Paul E . McKenney" Cc: Uladzislau Rezki , Oleksiy Avramchenko , Jens Axboe , Philipp Reisner , Bryan Tan , Steven Rostedt , Eric Dumazet , Bob Pearson , Ariel Levkovich , Theodore Ts'o , Julian Anastasov , Pablo Neira Ayuso , Jiri Wiesner Subject: [PATCH 10/13] ipvs: Rename kfree_rcu() to kfree_rcu_mightsleep() Date: Wed, 1 Feb 2023 16:09:51 +0100 Message-Id: <20230201150954.409693-1-urezki@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756642145235727597?= X-GMAIL-MSGID: =?utf-8?q?1756642145235727597?= The kfree_rcu()'s single argument name is deprecated therefore rename it to kfree_rcu_mightsleep() variant. The goal is explicitly underline that it is for sleepable contexts. Cc: Julian Anastasov Cc: Pablo Neira Ayuso Cc: Jiri Wiesner Signed-off-by: Uladzislau Rezki (Sony) --- net/netfilter/ipvs/ip_vs_est.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netfilter/ipvs/ip_vs_est.c b/net/netfilter/ipvs/ip_vs_est.c index ce2a1549b304..a39baf6d1367 100644 --- a/net/netfilter/ipvs/ip_vs_est.c +++ b/net/netfilter/ipvs/ip_vs_est.c @@ -549,7 +549,7 @@ void ip_vs_stop_estimator(struct netns_ipvs *ipvs, struct ip_vs_stats *stats) __set_bit(row, kd->avail); if (!kd->tick_len[row]) { RCU_INIT_POINTER(kd->ticks[row], NULL); - kfree_rcu(td); + kfree_rcu_mightsleep(td); } kd->est_count--; if (kd->est_count) { From patchwork Wed Feb 1 15:09:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 51399 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp334374wrn; Wed, 1 Feb 2023 07:14:29 -0800 (PST) X-Google-Smtp-Source: AK7set/NCV4vo+Uu4NGTUT3ea2Q1Pg1UenNcJJKHcPTWMl0qsbdlFyVF8sri1TVQKGFWd05U3rcH X-Received: by 2002:a17:903:228e:b0:196:2acf:f27a with SMTP id b14-20020a170903228e00b001962acff27amr18810819plh.36.1675264469652; Wed, 01 Feb 2023 07:14:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675264469; cv=none; d=google.com; s=arc-20160816; b=JK+wSQG8rhCM3NFyJwma5Riy8il7PM8cZDhD7H9BLRRB3ixOFtgG47hfloCd/CiUxF cdssQnzf82JTAThOkDndImcXF/OY0DizUdP4fxoqPfc4Km7tG8vRwPvTdvkTpcxMP9AX KrdVoYtMToSrrRq7xchbLEHNe0UADXZEGwQ8go7Xmh0Lm7O/B9x6gjaXpOfiCxZKLbEl 3+RQlM+xkc/a7ChOELCmtohBx83na/9KCf621bDEV7VY0bPWBCbRdV5jAlNgNk70dXW0 kvC+x/SJVlSnjd+LiT7HXymQcwYMXqn2H/oNTG5mCve/73aw1Oi12aLDAkilEw69xFi3 nmvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=w+s0R1N5QaJjHALhKlJSDlz82DJDrm00TxCc4cLTynw=; b=NP2yTohOvieyjTwQvvPhh9Gr5HHM2Ls2TJUJ1eJu8VVKSK37oWN4Uv7O9dwLSjfAns y8hwwncb4+PNAtp32AtZZHE7ObWb196ziHRZpNxKrta1FNM6uCzBLUmu11auFBuvsamo Ri7sigoLZX7QrmL6MrD7IF122Fk/76o1su28s6dk3BQ/KFqLCQ0/wLtjLL2v8z4OKmEp OskIG+gsLtQVVliB2g3q/ggsgxprilrdYiA9elz+TRVHdS9nMTEv8yT11dA1aRfje/j3 owJ8mdiv2IUj0NH20rps4O0FgPNvVL8SQtIInuOnndM87lns+YmTMsJtnE+hS9NvwAiT v11Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Qy9VJITe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s10-20020a170902ea0a00b001961c421957si21248515plg.159.2023.02.01.07.14.17; Wed, 01 Feb 2023 07:14:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Qy9VJITe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231773AbjBAPLY (ORCPT + 99 others); Wed, 1 Feb 2023 10:11:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231910AbjBAPK2 (ORCPT ); Wed, 1 Feb 2023 10:10:28 -0500 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 373595BA3; Wed, 1 Feb 2023 07:09:59 -0800 (PST) Received: by mail-ej1-x631.google.com with SMTP id qw12so36384652ejc.2; Wed, 01 Feb 2023 07:09:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=w+s0R1N5QaJjHALhKlJSDlz82DJDrm00TxCc4cLTynw=; b=Qy9VJITeqinyGIT2g5k9PON9xuMsEZT32GMlDTA7zKIvzrlg5Z211EN1RzNeTX/mNx nB5CLyJHh3Jki7YQ3/feplUozmCCzwX1ABJbBEk2RbAJxdV8EcftopU3SZwc3oXTvymF k6VS/x2dgKnZDlwFr4kbgcolrs3bANv222/mQeCp/UpBMsRydfmSh4USN4/KodAA5dCM o23R5/YrTratVJXjGVfe8Eeq3+LaMjQKspQXMG6ZS4KqDWY2ip5IdBJJj4j3VPheGkwI 8xeu6PT8TkD1oT+v3cdyuB4fH8botO5lAi08pY5ZdqYTdMxfETjNiF/QcxXgYqymXO3S ZxxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=w+s0R1N5QaJjHALhKlJSDlz82DJDrm00TxCc4cLTynw=; b=FZlRI6RK/Sc5gg0MCcZ7p6deM5MSt1xxfJg9rVWr24clyU+pHbVWTFayO50FeVLsye y5FA366yOzJCXp+QvZCa94GTH5NDVc57c2XjZaGRXEUg64YZjm0Qrd7XQ2pJo6Wfzzxk iGHb/7AxPj4OnC67j0c5cPD2d1ArWzZX0dZjXdceoEKz76R4pM+qJfRjvFe/D3wbDuKO MpRSDMq5YU7thONKuGn0bIHNrj7ICB/PKLGNASSukaXhfEby0TrmR8XkCpaFMBftLpmm CqcbwCu3gAgH5iU81XobYlkNFpnDXt8+M8smQpM96bRpgBGIZEQL3fIvCz4aPjnFQlYl 4QCg== X-Gm-Message-State: AO0yUKXkUYljtJt/UYHnQFDkT/cxvxpohkYx0Kh/KOmPVu8UGxKFD6VJ /bp9gnC9iLnhwhN2niPhRoz0/B5xJNtCbg== X-Received: by 2002:a17:906:688b:b0:87b:7c1d:e02b with SMTP id n11-20020a170906688b00b0087b7c1de02bmr2263849ejr.36.1675264197595; Wed, 01 Feb 2023 07:09:57 -0800 (PST) Received: from pc638.lan ([155.137.26.201]) by smtp.gmail.com with ESMTPSA id fe15-20020a1709072a4f00b008845c668408sm6627147ejc.169.2023.02.01.07.09.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 07:09:57 -0800 (PST) From: "Uladzislau Rezki (Sony)" To: LKML , RCU , "Paul E . McKenney" Cc: Uladzislau Rezki , Oleksiy Avramchenko , Jens Axboe , Philipp Reisner , Bryan Tan , Steven Rostedt , Eric Dumazet , Bob Pearson , Ariel Levkovich , Theodore Ts'o , Julian Anastasov Subject: [PATCH 11/13] rcuscale: Rename kfree_rcu() to kfree_rcu_mightsleep() Date: Wed, 1 Feb 2023 16:09:52 +0100 Message-Id: <20230201150954.409693-2-urezki@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230201150954.409693-1-urezki@gmail.com> References: <20230201150954.409693-1-urezki@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756642116523562407?= X-GMAIL-MSGID: =?utf-8?q?1756642116523562407?= The kfree_rcu()'s single argument name is deprecated therefore rename it to kfree_rcu_mightsleep() variant. The goal is explicitly underline that it is for sleepable contexts. Signed-off-by: Uladzislau Rezki (Sony) --- kernel/rcu/rcuscale.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/rcu/rcuscale.c b/kernel/rcu/rcuscale.c index 4120f94030c3..e82ec9f9a5d8 100644 --- a/kernel/rcu/rcuscale.c +++ b/kernel/rcu/rcuscale.c @@ -715,7 +715,7 @@ kfree_scale_thread(void *arg) // is tested. if ((kfree_rcu_test_single && !kfree_rcu_test_double) || (kfree_rcu_test_both && torture_random(&tr) & 0x800)) - kfree_rcu(alloc_ptr); + kfree_rcu_mightsleep(alloc_ptr); else kfree_rcu(alloc_ptr, rh); } From patchwork Wed Feb 1 15:09:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 51397 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp334254wrn; Wed, 1 Feb 2023 07:14:20 -0800 (PST) X-Google-Smtp-Source: AK7set9cI+qLrganOB4kIpLDnSbeIUNUisI9wxmGRExnRwcCv/SZyg7J2WHDnHN7ePJRSNmPifsz X-Received: by 2002:a05:6a21:3291:b0:bc:50a6:5944 with SMTP id yt17-20020a056a21329100b000bc50a65944mr3544268pzb.38.1675264460436; Wed, 01 Feb 2023 07:14:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675264460; cv=none; d=google.com; s=arc-20160816; b=WlMPS2WdBnhCRCyg3wHcMUJynO8AGv8b4cQUb+MrrWwq5ZksHrfl8Nnj0C6PWpzkem B5JG2TyFEphNj6mudbEO8ZPkX61Fct7u9IQfqMmn6yFy0mQcpxcD+SZluTCU+xRo9WIu AF28WlXq1Ec7H5Pq11TdDyDVYckCtDuuJgUytVsyBa3mPQLkNn9i9Q6FYWHtW+feMvGG UkiOg7tu832myamHRlkgAs92YjETCXoGZmuT/2OLe1tzmUmAKNErL0A5L7O1tyte/2gl p/sCObMpYEamo6E60T3F8gM5GR7xVH+ingsW8EQAoEMW1y7Y3/77POe0n5byun21B5FL 6zTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=udBAvOMF3811JfYnSoT7LY+mJh84zG4u72FA8SZ9FR4=; b=yBXbHI2QhRRHtkJKlCIClxiPVAhZTyNPiDBtxwE25wFzXCPeyZVV2wJJCRiAJKGCrx 4LhK3y6TsRECINo/D+YcMGcGR2MlIBBmFvyqhoFIvGLNPjqkWlh1KJ4BdRByffXDdDId fbiD2CW0N1sQ7Vtk9dr8ZfcF6ZjLPtwh5DpeUOdfoTQWnsF9S0svnWos/eIZrRwIAQF/ 7sfl8+xONXoUZFYB+sV+ABgRJvGTQq2ceLXqkPiwB1pvTvwkF1IgQm4VcX5urykVxIlf rltKyP7VdwvjVyx303gkrOvdPmEtj6hY59MGc+JIR2RMYBIh1P2omFANyFNYpuWjn1gC pIvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=OHVpVmxe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 123-20020a630181000000b004e38759b423si14486511pgb.145.2023.02.01.07.14.07; Wed, 01 Feb 2023 07:14:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=OHVpVmxe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232229AbjBAPLS (ORCPT + 99 others); Wed, 1 Feb 2023 10:11:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232045AbjBAPK2 (ORCPT ); Wed, 1 Feb 2023 10:10:28 -0500 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E95F6A4A; Wed, 1 Feb 2023 07:10:00 -0800 (PST) Received: by mail-ej1-x62f.google.com with SMTP id me3so52324270ejb.7; Wed, 01 Feb 2023 07:10:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=udBAvOMF3811JfYnSoT7LY+mJh84zG4u72FA8SZ9FR4=; b=OHVpVmxeTI4WIC/hMW77qq/3M0DYZ8oeiiu5IwlZPDc2WrZd5zGiPSY3+MgQshnyhq q8RRXneNaoThH+BSsl7yGpGAXOIdI5GQ2o+idk+Ep7WHv7x60cthSzv9HyAhJdcE+wfc 11xvrWuwk/WVhOz/ALiP14scR4RIIfgymPP+u4yoVFyJRZRgNXbAUL83fypVgRO/8MED dbSP9u/V6eFX/Hgjet+gdwWTsjdEo8acvqFDhgqNb1+3macxbT2UqHm0ognGTVKgR3ji b1p5ScJtqq3hCyJWVjyfnl4D/LceUb0ApBREvhvbaGZb+5LWDvVt3VnZbjRjqHmtAc6Q qwJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=udBAvOMF3811JfYnSoT7LY+mJh84zG4u72FA8SZ9FR4=; b=AhFMEMzO+so2ItRBqS0N1pJcafxsOq23BsiihevxFADEUynU5KPB4mUrmeWiHmGOQx JgN/YrfvS2U9/Am1mG2U01RONH14w9EgKhSvLT1Og7S+VcWof4cgHtI89v41VyBG6cOc G1wPbC3i8SBURnG3ubSHy06kdJIYs0jRRMDRGxtLApLZplCoOFBR/0f2mJupaBoEPxa1 fEGxGlJOmT+CrFcHMHuN9xteKwUlDRBltWRslCZ8cvjsO17NRrA34+lmRKLoY1oCNwEf ioZTwPCGAK/8u/TN/YxDuhIGAU24UTMOf+O5CXZMx7i2+FCJZjPZLIy3z90hT6FpBZRs WHgw== X-Gm-Message-State: AO0yUKXO7BDJQEnBh3UClnNoC8myNs+GF0+dvPN31zDrGf2PMp/NUkV4 Ni3tJ0NDuJFycf0V6oUbOhztK48Us2n6PA== X-Received: by 2002:a17:907:6d15:b0:877:6549:bb6 with SMTP id sa21-20020a1709076d1500b0087765490bb6mr3397994ejc.58.1675264198532; Wed, 01 Feb 2023 07:09:58 -0800 (PST) Received: from pc638.lan ([155.137.26.201]) by smtp.gmail.com with ESMTPSA id fe15-20020a1709072a4f00b008845c668408sm6627147ejc.169.2023.02.01.07.09.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 07:09:58 -0800 (PST) From: "Uladzislau Rezki (Sony)" To: LKML , RCU , "Paul E . McKenney" Cc: Uladzislau Rezki , Oleksiy Avramchenko , Jens Axboe , Philipp Reisner , Bryan Tan , Steven Rostedt , Eric Dumazet , Bob Pearson , Ariel Levkovich , Theodore Ts'o , Julian Anastasov Subject: [PATCH 12/13] doc: Update whatisRCU.rst Date: Wed, 1 Feb 2023 16:09:53 +0100 Message-Id: <20230201150954.409693-3-urezki@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230201150954.409693-1-urezki@gmail.com> References: <20230201150954.409693-1-urezki@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756642106842419702?= X-GMAIL-MSGID: =?utf-8?q?1756642106842419702?= The kfree_rcu() macro is deprecated. Rename it to the kfree_rcu_mightsleep() in this documentation. Signed-off-by: Uladzislau Rezki (Sony) --- Documentation/RCU/whatisRCU.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/RCU/whatisRCU.rst b/Documentation/RCU/whatisRCU.rst index 2c5563a91998..8eddef28d3a1 100644 --- a/Documentation/RCU/whatisRCU.rst +++ b/Documentation/RCU/whatisRCU.rst @@ -597,10 +597,10 @@ to avoid having to write your own callback:: If the occasional sleep is permitted, the single-argument form may be used, omitting the rcu_head structure from struct foo. - kfree_rcu(old_fp); + kfree_rcu_mightsleep(old_fp); -This variant of kfree_rcu() almost never blocks, but might do so by -invoking synchronize_rcu() in response to memory-allocation failure. +This variant almost never blocks, but might do so by invoking +synchronize_rcu() in response to memory-allocation failure. Again, see checklist.rst for additional rules governing the use of RCU. From patchwork Wed Feb 1 15:09:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 51407 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp334890wrn; Wed, 1 Feb 2023 07:15:17 -0800 (PST) X-Google-Smtp-Source: AK7set99KHmqr8cENkboXy6raPd4HP4ZVjdUGwIMFNDjCWNtkwJ1ROOKA6LZ5TIS9hW5IIRXsgnA X-Received: by 2002:a17:902:e1d2:b0:196:6eaf:736b with SMTP id t18-20020a170902e1d200b001966eaf736bmr2664213pla.1.1675264516874; Wed, 01 Feb 2023 07:15:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675264516; cv=none; d=google.com; s=arc-20160816; b=BUejEBlzAk49LCtcJFnn8m0BcXjWG+0IyAdr5uatWtiRGV/HHd5FAMjxlVZdVeOuSQ yo9e3rhu73ZOQqLqj4+/paHMHsphCVs3pKw/ZGyIFzJ7s10Mzv1r4NzUdZBYdzWLk0VJ vvd828lU7fr/PDeBCF/e8bcIQ7hC/2dvnarIogpg3hMRhLBi2wF/aEkIIKQIqWCSitEm Qb7Bhgq1eMtzw2abVe5CuJI4ai46p8+HMO8pWxhA199As6GFeXdqBbdXLYDtkUL4DLJG fkDrGeVp5fIqvGEJWoIAfg8WXGnYO+IKNCeBtwZUlnFvzuQq9GWCNr18RY8jVQRh0tBM OUpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Vhev8pughE32czPvaqr1hnewEVhkAHaQpP6Xqs+9d/I=; b=Sf7wrvK/lt2laHJF3IzrLrNK6giSanhqB5ovNsC0RKrYtM9v1M/2ow21Hf6chCfIzy zB/dnQGeNXjDdRsX4Zf3p6IpN6nxiM7Zhqkx7PBBjlQyvcqyx0kuR2E1ZMwmvadXIepr iIYPBW6fotPhtfg2OGmGLfwjMUn5eHOB0BClY/fUrOGiF6W7KgPqE5+oSMW4+0bKPaVj q/FmtafKb8NFdBoD8W/Fz2OVQsImNcwCXeSDPXafq5NVEYLlWCo0OSdsh4wBuEDWKGmP ezcdxsGC7PxXYSyX6Y20G2TWlfIkFD+qlWv5QqKzFBI5UTHpOsOYHP4NmTvhi/5Cz9HU Ouhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=I0Yz0URD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x7-20020a1709029a4700b001963f6a1b41si18644287plv.37.2023.02.01.07.15.05; Wed, 01 Feb 2023 07:15:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=I0Yz0URD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232159AbjBAPL1 (ORCPT + 99 others); Wed, 1 Feb 2023 10:11:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232065AbjBAPK2 (ORCPT ); Wed, 1 Feb 2023 10:10:28 -0500 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F20E56A5D; Wed, 1 Feb 2023 07:10:00 -0800 (PST) Received: by mail-ej1-x634.google.com with SMTP id ml19so28755693ejb.0; Wed, 01 Feb 2023 07:10:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Vhev8pughE32czPvaqr1hnewEVhkAHaQpP6Xqs+9d/I=; b=I0Yz0URD7aG/WEZFb91AhJOqAM9Svs5gUZnPvEyipLUwAuuxMoV4egTWKgmrqQUlFE NPD9W7xEbBqgw657uIcFOrDyaypDLshT+crSYGoL6atspA5SmDLQSmiT3C/jKFJ2BebT 0PStnMFMhVhO1+tFAPEEoCXo2+Mplg2XmKX51qw0Gaw5HzVWWw5odGpbv+ncXV5VHLPp us03GnHlSiwyn8iNPeICxim/iofFxgAMpGkL0B5SJlTJ8RVFeuaVC9z7+gF58qH5kul9 JUaRglao/0qg/re9KkFJgoVDlQKOBYzo7J/yQbkYG2KYGTWiV7PCGMvnH4G6kgIBjMUM fr3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Vhev8pughE32czPvaqr1hnewEVhkAHaQpP6Xqs+9d/I=; b=GkBPPpzauyIrZlQJUdKnIoa1FOiMN+JhjX2QJNrLMQGI6Ymth98ANHIN0K8O0v3Zek g00BGBKUjQu6W5izd+9P7CloKUHBUVsceL4Lo5EFT1lJrUNmliSNbrqR5EQgoYfawLV1 2v7ZHq5R4AXFlf1f3NsG5rFAPLhj7oJkgUrkGXT/5tKNzhLQe6GjUassUhxmk6FlBUqr fK+Y3lnYrBOIfk4ah58aWlpX/0x6jpvkPxwztmoePW861QcslDGUTh6XeRdwAjGw6W1W 8uj4ul++ILcyOiCCF8O+FYOzKtBlfLeRR7a0YSgSFBQjneMgh8Ue9ieY3OsbGGPOS686 GLCw== X-Gm-Message-State: AO0yUKXflUObqNHnDBC4R+tFBPQsBzsDFq3jnwPnsNd93UfRpSx3CwGi VlQZWNX7FiiX18yx+aPs9h/exDoceb560A== X-Received: by 2002:a17:906:a1c6:b0:878:816f:8691 with SMTP id bx6-20020a170906a1c600b00878816f8691mr2420872ejb.71.1675264199463; Wed, 01 Feb 2023 07:09:59 -0800 (PST) Received: from pc638.lan ([155.137.26.201]) by smtp.gmail.com with ESMTPSA id fe15-20020a1709072a4f00b008845c668408sm6627147ejc.169.2023.02.01.07.09.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 07:09:59 -0800 (PST) From: "Uladzislau Rezki (Sony)" To: LKML , RCU , "Paul E . McKenney" Cc: Uladzislau Rezki , Oleksiy Avramchenko , Jens Axboe , Philipp Reisner , Bryan Tan , Steven Rostedt , Eric Dumazet , Bob Pearson , Ariel Levkovich , Theodore Ts'o , Julian Anastasov Subject: [PATCH 13/13] rcu/kvfree: Eliminate k[v]free_rcu() single argument macro Date: Wed, 1 Feb 2023 16:09:54 +0100 Message-Id: <20230201150954.409693-4-urezki@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230201150954.409693-1-urezki@gmail.com> References: <20230201150954.409693-1-urezki@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756642166261957641?= X-GMAIL-MSGID: =?utf-8?q?1756642166261957641?= For a single argument invocations a new kfree_rcu_mightsleep() and kvfree_rcu_mightsleep() macroses are used. This is done in order to prevent users from calling a single argument from atomic contexts as "_mightsleep" prefix signals that it can schedule(). Signed-off-by: Uladzislau Rezki (Sony) --- include/linux/rcupdate.h | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 094321c17e48..7571dbfecb18 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -957,9 +957,8 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) /** * kfree_rcu() - kfree an object after a grace period. - * @ptr: pointer to kfree for both single- and double-argument invocations. - * @rhf: the name of the struct rcu_head within the type of @ptr, - * but only for double-argument invocations. + * @ptr: pointer to kfree for double-argument invocations. + * @rhf: the name of the struct rcu_head within the type of @ptr. * * Many rcu callbacks functions just call kfree() on the base structure. * These functions are trivial, but their size adds up, and furthermore @@ -982,26 +981,18 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) * The BUILD_BUG_ON check must not involve any function calls, hence the * checks are done in macros here. */ -#define kfree_rcu(ptr, rhf...) kvfree_rcu(ptr, ## rhf) +#define kfree_rcu(ptr, rhf) kvfree_rcu_arg_2(ptr, rhf) +#define kvfree_rcu(ptr, rhf) kvfree_rcu_arg_2(ptr, rhf) /** - * kvfree_rcu() - kvfree an object after a grace period. - * - * This macro consists of one or two arguments and it is - * based on whether an object is head-less or not. If it - * has a head then a semantic stays the same as it used - * to be before: - * - * kvfree_rcu(ptr, rhf); - * - * where @ptr is a pointer to kvfree(), @rhf is the name - * of the rcu_head structure within the type of @ptr. + * kfree_rcu_mightsleep() - kfree an object after a grace period. + * @ptr: pointer to kfree for single-argument invocations. * * When it comes to head-less variant, only one argument * is passed and that is just a pointer which has to be * freed after a grace period. Therefore the semantic is * - * kvfree_rcu(ptr); + * kfree_rcu_mightsleep(ptr); * * where @ptr is the pointer to be freed by kvfree(). * @@ -1010,13 +1001,9 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) * annotation. Otherwise, please switch and embed the * rcu_head structure within the type of @ptr. */ -#define kvfree_rcu(...) KVFREE_GET_MACRO(__VA_ARGS__, \ - kvfree_rcu_arg_2, kvfree_rcu_arg_1)(__VA_ARGS__) - +#define kfree_rcu_mightsleep(ptr) kvfree_rcu_arg_1(ptr) #define kvfree_rcu_mightsleep(ptr) kvfree_rcu_arg_1(ptr) -#define kfree_rcu_mightsleep(ptr) kvfree_rcu_mightsleep(ptr) -#define KVFREE_GET_MACRO(_1, _2, NAME, ...) NAME #define kvfree_rcu_arg_2(ptr, rhf) \ do { \ typeof (ptr) ___p = (ptr); \