From patchwork Thu Nov 17 03:15:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 13046047 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C720C433FE for ; Thu, 17 Nov 2022 03:16:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234404AbiKQDQH (ORCPT ); Wed, 16 Nov 2022 22:16:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231564AbiKQDQG (ORCPT ); Wed, 16 Nov 2022 22:16:06 -0500 Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 611FA627F4 for ; Wed, 16 Nov 2022 19:16:04 -0800 (PST) Received: by mail-qt1-x82c.google.com with SMTP id c15so373284qtw.8 for ; Wed, 16 Nov 2022 19:16:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=S1ptF9mncQNJ+YzPoHhaIMd3nHddn4TGB/DoUobLdZU=; b=GcfN8q0cdS6ovJPkcYbDaqLvjp2zegbXELs5S4CRJutF7b+qeUEjdTBvXgBMq/OP0O 5F0oDVaz0IMlsc3dJM130Zm51BsN/20FkgL5+YveFNxpF5QeQZUfW2actFnGJSzQOl7k 9FJPLPu3eSIQwGzgteA3hAdyBxrFV0KXV9dzw= 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=S1ptF9mncQNJ+YzPoHhaIMd3nHddn4TGB/DoUobLdZU=; b=daN31oXMzIpiHw6YSYhHlXdrTdQYorpjhI3T3aUuQWALQsmcFBE7xHz4thGPo594Q1 hsknhF8J1W+umEoX7J6FL1bjSGeUjBibN1mdwieJxn5N0CJuXputV9lXgmJu1W+DKP6H Eow3DgwweCSVP8HK9ytZqi5mGnUvfSEURlYODmYpYZ0Z6k5oqVgCb5Gatsu0wrHf30Ud hHcw6MQmjCb+kia4+xOThBGbVE22nWpsf/0eKK5z8TgUKx08/+kw+wHEzPoB2EXMt3E4 PKy4iXOQnXbF873ohHyWw4V15je6gF8SKCLSGjQP33Jogvm5iGmgmxsmys1v6vgG+SOR BcpQ== X-Gm-Message-State: ANoB5pkgx9Oc8ZpExKhI9m1BYnS2wdSCS0aW0Y58qjKe04QPlwLVXdxZ K55TDOUZ1K8g4EnnFjBu9cOW1g== X-Google-Smtp-Source: AA0mqf6wIKIMbSXoQzryo0edy3a17i21tuwAle5TzhjMCIbXHB1V2gGJhQuKdO3B3/Yxj47fWCqMTA== X-Received: by 2002:a05:622a:401b:b0:3a5:2c7c:c915 with SMTP id cf27-20020a05622a401b00b003a52c7cc915mr722597qtb.499.1668654963515; Wed, 16 Nov 2022 19:16:03 -0800 (PST) Received: from joelboxx.c.googlers.com.com (228.221.150.34.bc.googleusercontent.com. [34.150.221.228]) by smtp.gmail.com with ESMTPSA id k19-20020a05620a415300b006cdd0939ffbsm11398318qko.86.2022.11.16.19.16.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 19:16:03 -0800 (PST) From: "Joel Fernandes (Google)" To: linux-kernel@vger.kernel.org Cc: "Joel Fernandes (Google)" , Cong Wang , David Ahern , "David S. Miller" , Eric Dumazet , Hideaki YOSHIFUJI , Jakub Kicinski , Jamal Hadi Salim , Jiri Pirko , netdev@vger.kernel.org, Paolo Abeni , rcu@vger.kernel.org, rostedt@goodmis.org, paulmck@kernel.org, fweisbec@gmail.com Subject: [PATCH rcu/dev 1/3] net: Use call_rcu_flush() for qdisc_free_cb Date: Thu, 17 Nov 2022 03:15:48 +0000 Message-Id: <20221117031551.1142289-1-joel@joelfernandes.org> X-Mailer: git-send-email 2.38.1.584.g0f3c55d4c2-goog MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: rcu@vger.kernel.org In a networking test on ChromeOS, we find that using the new CONFIG_RCU_LAZY causes a networking test to fail in the teardown phase. The failure happens during: ip netns del Using ftrace, I found the callbacks it was queuing which this series fixes. Use call_rcu_flush() to revert to the old behavior. With that, the test passes. Signed-off-by: Joel Fernandes (Google) --- net/sched/sch_generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index a9aadc4e6858..63fbf640d3b2 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c @@ -1067,7 +1067,7 @@ static void qdisc_destroy(struct Qdisc *qdisc) trace_qdisc_destroy(qdisc); - call_rcu(&qdisc->rcu, qdisc_free_cb); + call_rcu_flush(&qdisc->rcu, qdisc_free_cb); } void qdisc_put(struct Qdisc *qdisc) From patchwork Thu Nov 17 03:15:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 13046048 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA143C4332F for ; Thu, 17 Nov 2022 03:16:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231564AbiKQDQI (ORCPT ); Wed, 16 Nov 2022 22:16:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233851AbiKQDQG (ORCPT ); Wed, 16 Nov 2022 22:16:06 -0500 Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7038563BBE for ; Wed, 16 Nov 2022 19:16:05 -0800 (PST) Received: by mail-qk1-x72f.google.com with SMTP id d7so404433qkk.3 for ; Wed, 16 Nov 2022 19:16:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; 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=TVyiieWly24z0z0fYFBjEvhMrkOmEI6OGYeufoegUM4=; b=phUx/1hExUXj+l6ZupXb949+eS0h2KoDX51zvVMU7Ie7h3iZCBke2E+BGODPJBV4tL xGjPEH8PMNVD5NL6U0rDwSD9odVjl6CMe7+lYIMoTphmU1iyZXlh7qyciMp422Gumrv7 eeX0U1xVIh4mhYZ+0J4/xwfFnxRJXhOqK1gQk= 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=TVyiieWly24z0z0fYFBjEvhMrkOmEI6OGYeufoegUM4=; b=UAtW5fcsh0+QGHq/Tz938UeDhlsI7Uez2/Ebn3OOqne60m+1d59U3uMhMrkgUg4QRC VDv7ojMjhcusTQLQzh5BeH+go2DKC7NKGuPqblo38y8C79ip1WyOW3vuLBaa8YZoRU5k VLs+MH1KaDXdubbHCmpgJ11kh6JfXKYqDo+nowiGDh9BAid3hhH1sfeQBsVjvxWgQRGG TmKiOLg2MjStVXeO9CBq/hz9RmYt5AzdGFR5kwfqzZxk+P/mOCBbDz6GkfRoZGezbMyf S+7VSe/Ykmf7KpGrf9BLutAvCReS7QEsrJ3erpidz7P7iqYOJidmqr0Rq0cqHlEhxIgd KJQA== X-Gm-Message-State: ANoB5pkEuvv2Fc1c9Kn4/6QmwLQYjvSzXNXzT1fkZMjgCy6QnxVMy23x 02JawiYtxWRduKW4NeRZ2wSAOg== X-Google-Smtp-Source: AA0mqf4iZQlFujHEBGLFvhYWg4vhUvvJjjCO/pv1TcbmlblMbmZxj6HXge1lTpprJ/0n5Y9W2BGmxQ== X-Received: by 2002:a05:620a:459f:b0:6fa:f76d:bbc1 with SMTP id bp31-20020a05620a459f00b006faf76dbbc1mr307187qkb.11.1668654964533; Wed, 16 Nov 2022 19:16:04 -0800 (PST) Received: from joelboxx.c.googlers.com.com (228.221.150.34.bc.googleusercontent.com. [34.150.221.228]) by smtp.gmail.com with ESMTPSA id k19-20020a05620a415300b006cdd0939ffbsm11398318qko.86.2022.11.16.19.16.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 19:16:04 -0800 (PST) From: "Joel Fernandes (Google)" To: linux-kernel@vger.kernel.org Cc: "Joel Fernandes (Google)" , Cong Wang , David Ahern , "David S. Miller" , Eric Dumazet , Hideaki YOSHIFUJI , Jakub Kicinski , Jamal Hadi Salim , Jiri Pirko , netdev@vger.kernel.org, Paolo Abeni , rcu@vger.kernel.org, rostedt@goodmis.org, paulmck@kernel.org, fweisbec@gmail.com Subject: [PATCH rcu/dev 2/3] net: Use call_rcu_flush() for in_dev_rcu_put Date: Thu, 17 Nov 2022 03:15:49 +0000 Message-Id: <20221117031551.1142289-2-joel@joelfernandes.org> X-Mailer: git-send-email 2.38.1.584.g0f3c55d4c2-goog In-Reply-To: <20221117031551.1142289-1-joel@joelfernandes.org> References: <20221117031551.1142289-1-joel@joelfernandes.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: rcu@vger.kernel.org In a networking test on ChromeOS, we find that using the new CONFIG_RCU_LAZY causes a networking test to fail in the teardown phase. The failure happens during: ip netns del Using ftrace, I found the callbacks it was queuing which this series fixes. Use call_rcu_flush() to revert to the old behavior. With that, the test passes. Signed-off-by: Joel Fernandes (Google) --- net/ipv4/devinet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index e8b9a9202fec..98b20f333e00 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -328,7 +328,7 @@ static void inetdev_destroy(struct in_device *in_dev) neigh_parms_release(&arp_tbl, in_dev->arp_parms); arp_ifdown(dev); - call_rcu(&in_dev->rcu_head, in_dev_rcu_put); + call_rcu_flush(&in_dev->rcu_head, in_dev_rcu_put); } int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b) From patchwork Thu Nov 17 03:15:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 13046049 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5482AC4321E for ; Thu, 17 Nov 2022 03:16:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229703AbiKQDQJ (ORCPT ); Wed, 16 Nov 2022 22:16:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234308AbiKQDQH (ORCPT ); Wed, 16 Nov 2022 22:16:07 -0500 Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EAF264A08 for ; Wed, 16 Nov 2022 19:16:06 -0800 (PST) Received: by mail-qt1-x82e.google.com with SMTP id l15so390198qtv.4 for ; Wed, 16 Nov 2022 19:16:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; 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=X9LBEXDD+Ph4SF0Q02heQyIynGLkO+luTsSJyIxQLi8=; b=JHB8aiQgqZr6T2488gjy0+mFOhHh2VyJvRopV5+pPWMJXZhxAwmnceQy5QEv3N8tOk Ne1NmLfUHfz0FDXUP8hNcvKOK5FPq4UpnuFxw8/1IO6+cRNfmUgFz3ciXPbZVkiiHxIV xS+aaBeY1m0r9PJS6zCglk21/419o+83mDIcQ= 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=X9LBEXDD+Ph4SF0Q02heQyIynGLkO+luTsSJyIxQLi8=; b=aYSJ9YS0fneyb2dbXf+5SFaCziCXmVaH2cuvZj99e5nFYlzefAQxQ02DCjtRjzIlj6 PcEsm4Jml102hZddaEU+iqUsCosxOBhStt05H+NlB2IzcZ1kYZG+7V2RByU1G5uHK7yS eBiBWLM6oMz6kXS9/FeE3P6seLGhd1JHfyMeM6agdekcy84z4w7DaSfenvkPkawK3bHy D2Oz+/1fYp80tXGGPjHoxT0Ziz4CSU1BBVAYis9coKSJM77k46jBBdSZkvNMmdWhfC+P ude1KrxnEarLATfw9Eehw18wV0MMURwKmXGGKEZeIIZfWucXXtop5UkR3C2UnbD7RgJv Dxqw== X-Gm-Message-State: ANoB5pl1F3HyxETp954VmhDm61lRUAl6eWLfb4BfCK2+oQcj1iDMIcQ7 eNmb5B0wpHMDJk8ekt9X03eJ1w== X-Google-Smtp-Source: AA0mqf6tYbb7aqh2iSUw+/DUxtEpt+XbSFQV9UPEmammY7VOC9v7BaLxv9VBsF2YJcPh3TQAZIKKew== X-Received: by 2002:a05:622a:4899:b0:3a5:64a0:5eba with SMTP id fc25-20020a05622a489900b003a564a05ebamr827383qtb.96.1668654965522; Wed, 16 Nov 2022 19:16:05 -0800 (PST) Received: from joelboxx.c.googlers.com.com (228.221.150.34.bc.googleusercontent.com. [34.150.221.228]) by smtp.gmail.com with ESMTPSA id k19-20020a05620a415300b006cdd0939ffbsm11398318qko.86.2022.11.16.19.16.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 19:16:05 -0800 (PST) From: "Joel Fernandes (Google)" To: linux-kernel@vger.kernel.org Cc: "Joel Fernandes (Google)" , Cong Wang , David Ahern , "David S. Miller" , Eric Dumazet , Hideaki YOSHIFUJI , Jakub Kicinski , Jamal Hadi Salim , Jiri Pirko , netdev@vger.kernel.org, Paolo Abeni , rcu@vger.kernel.org, rostedt@goodmis.org, paulmck@kernel.org, fweisbec@gmail.com Subject: [PATCH rcu/dev 3/3] net: Use call_rcu_flush() for dst_destroy_rcu Date: Thu, 17 Nov 2022 03:15:50 +0000 Message-Id: <20221117031551.1142289-3-joel@joelfernandes.org> X-Mailer: git-send-email 2.38.1.584.g0f3c55d4c2-goog In-Reply-To: <20221117031551.1142289-1-joel@joelfernandes.org> References: <20221117031551.1142289-1-joel@joelfernandes.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: rcu@vger.kernel.org In a networking test on ChromeOS, we find that using the new CONFIG_RCU_LAZY causes a networking test to fail in the teardown phase. The failure happens during: ip netns del Using ftrace, I found the callbacks it was queuing which this series fixes. Use call_rcu_flush() to revert to the old behavior. With that, the test passes. Signed-off-by: Joel Fernandes (Google) --- net/core/dst.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/dst.c b/net/core/dst.c index bc9c9be4e080..15b16322703f 100644 --- a/net/core/dst.c +++ b/net/core/dst.c @@ -174,7 +174,7 @@ void dst_release(struct dst_entry *dst) net_warn_ratelimited("%s: dst:%p refcnt:%d\n", __func__, dst, newrefcnt); if (!newrefcnt) - call_rcu(&dst->rcu_head, dst_destroy_rcu); + call_rcu_flush(&dst->rcu_head, dst_destroy_rcu); } } EXPORT_SYMBOL(dst_release);