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: 21393 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp189491wrr; Wed, 16 Nov 2022 19:18:03 -0800 (PST) X-Google-Smtp-Source: AA0mqf7s00dZdm8Ofi9WqrppQ2LwqCu/pZIvnB0nQRkHtayWtML7snwLyzuI+c3wYTx4UMV7WAhW X-Received: by 2002:a17:902:e84f:b0:186:ff4a:a1f0 with SMTP id t15-20020a170902e84f00b00186ff4aa1f0mr909124plg.57.1668655082999; Wed, 16 Nov 2022 19:18:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668655082; cv=none; d=google.com; s=arc-20160816; b=reg1lOqPt6Ck6T6eG0k0w57fBkYNPJuMJQLKig36gKtTImA8/fSIiwaOVEOBap4xG1 A5X/dH2GiG6rC+LMMYhl8JktvdreEmjf9zH32lddGLlsv0XEhO8K8bV5h6SWsDi58chx uooMepmgDOacxfsTaFLH5g8PVgmlFq0nkYm2VCF6ZZWZnAauNdUItENN636UYzJg380z vzoo454ACJ8lZw+GO5+VlvGJrnUp1dInKK0lOqepuL1awBWOX+jSXf1gIcETzO9BT2Cx 38qqGNujNaseSQfCz9EPcWJiO59o3476ODgc936v8/O7PKJrgvazv+WXUned75EHUdPA K8XA== 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=S1ptF9mncQNJ+YzPoHhaIMd3nHddn4TGB/DoUobLdZU=; b=V2TbiLy5ioa9cnld+daROGysrZqkXzChjOJlc52uHKO84B2Jr0Qhr/EYRndoQHKOkD YElEZScJQaurBc3JMBdeajqvrxtit9WnlSOvyUdn7am6HPMx/iTBMZN9ygBXqHzMNJZC tLnzPZHYPi+LjlqcuZ0T/owTQf5n97TVK8W33MhL3vu9afMIr/ZhByw0A6pdW6XRp3WM eYDCRsUuufpgbLTXjO2SsfEUJp09Zk6q3TVyV1UpFT5DYm9osw+dfEhgcw+qBBvz3GMH PUzesaYBMVFRuhRHBdbhBBSY8pUO1gbBRKu6SwwSVi3UxKMWv2aQJCMtvd7h2+hBPYmH 4ltQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=GcfN8q0c; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q12-20020a056a00150c00b0056771c032f4si17438361pfu.28.2022.11.16.19.17.50; Wed, 16 Nov 2022 19:18: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=@joelfernandes.org header.s=google header.b=GcfN8q0c; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234510AbiKQDQK (ORCPT + 99 others); Wed, 16 Nov 2022 22:16:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233331AbiKQDQG (ORCPT ); Wed, 16 Nov 2022 22:16:06 -0500 Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 906EE63CF5 for ; Wed, 16 Nov 2022 19:16:04 -0800 (PST) Received: by mail-qt1-x82b.google.com with SMTP id fz10so390346qtb.3 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=zmoY84PR+8XKKqB8Ayg0815izaRkOx/0Cg22x7C4iLFE3Dcw8YxK3X25VfyTtGpeTA unV/9JBxovf88W0hKfOjYoRSzmRxmDUOSdyf96hw+iEgh1QGm+fl1znVM35etAQXubZw BzZCqDku+AmbhVcK2eggM383hhhZYTaD98riKDkUnjeqtIe3VRzKynmEZ5j8bNQU4OWh A5H4P/rjJtoTwmSOKec75O/ntVIALggBtXPO4PU2Kf5mmTtYPE+tfJLMqlGktlSFKz7e N+CUHyWmQNMnzkHgMWzrtqW6XAEs2mJyKhqHGJ1myolondEKOhNEGb6riifiy5QL9HYX yrIA== X-Gm-Message-State: ANoB5plNnUEXZDumyw+gxl5na8fVZvUc96Qhzemgio8+MT+6DvkHqAip MHKtQmGyhSSkImbmliHmZ7kijWnAKZoBmA== 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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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?1749711672287438358?= X-GMAIL-MSGID: =?utf-8?q?1749711672287438358?= 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: 21394 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp189504wrr; Wed, 16 Nov 2022 19:18:06 -0800 (PST) X-Google-Smtp-Source: AA0mqf7snNh1IWoBlBDr+I/CfsJ0AfVQwUqVXO13GMpVY6kP+p275PXKDZwt8vK1o8rO3f23qni9 X-Received: by 2002:aa7:93b4:0:b0:56d:1fdc:9d37 with SMTP id x20-20020aa793b4000000b0056d1fdc9d37mr954972pff.77.1668655086009; Wed, 16 Nov 2022 19:18:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668655086; cv=none; d=google.com; s=arc-20160816; b=lx4AoF4qV7Pt4/wHsXr4xCYUeup0J+O+HfOZiIQPuEBd0MmwHLNivSu1lEDy4iJg6L w7Km+xpHgQSr6YWiOsTXd3TtdLWey+6h+UCgXQ3uKPlbn3AXEAfJr+xHvLNdxiggoyaM JIAvbwnVD0TEkCJkra9xdVjYQiDqS6LuC5n8rPeSNcQP2of9GbOT09A0Eg7fPcoLVhWQ YO4y6BfpLu3yKNvuG0cSc1X+JFa2EOoqKigpXzozSZotp/Nqu9+l+E3G8VhcFg8vecLP qETDMSwAXy4A7u6t2+J6ucTxAlK/ESxVJG1dJS9lFEDjnnzKrtsBuuGRz2E1wWg8E5MN D9WQ== 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=TVyiieWly24z0z0fYFBjEvhMrkOmEI6OGYeufoegUM4=; b=FCzrVi4UkjDviM+7SPszOeErQzpGqsIapM7owJZl1QChfIytmHk8C5St4+E97EdzkO nr+fz4t4S7QGcvWlG9nKxrErwGVtFtIlhuwSwrZu4pPsz3UZFFfy7V6NiN+tu8QO/aUQ x4L6swoSazDysSQsefIr11w//FjMa5XNRuTN8m6MWBq8f1LCnFrEgn1Y/2sLs3BnLbGo YphI4qXDOIV/YhQUSdb0RmMIl3aAkZA05F6eNLrEbnHMi4z1GQs208bsxQR1ZvrsEqfC 8mQ6ZwwsJ6TMvGGzkb0k9GGpvL21sgNQZdhucUkgiAVk6gfZMLifG2XGVLT98Qm6uOUX uOLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b="phUx/1hE"; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s20-20020aa78294000000b005669b9f5e1bsi14728069pfm.45.2022.11.16.19.17.52; Wed, 16 Nov 2022 19:18:05 -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=@joelfernandes.org header.s=google header.b="phUx/1hE"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234661AbiKQDQN (ORCPT + 99 others); Wed, 16 Nov 2022 22:16:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234166AbiKQDQG (ORCPT ); Wed, 16 Nov 2022 22:16:06 -0500 Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EBBB64A04 for ; Wed, 16 Nov 2022 19:16:05 -0800 (PST) Received: by mail-qk1-x729.google.com with SMTP id z17so379368qki.11 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=jVhHF+RUQ5ssDW4yX1/babfZSNoQjbtkP938NU0gKUOyR1ih3BtBHeoHSL/2jMFZKM 0JBn8PFdPDU8QI/CRcbjcuAioihyHzZX6AmFPLiwTeEP5PYnz3FoiwvlTnDDFntDkn6E ZQPiTVWzlPcTnEMlWAgUL3VOjxjAbhoycOy3CcThJdvLcYsM+VkzlTPkwwjIJpDoRGPB 3o/vX0hrMmHDfiCNvVmXwMTYgBCct9YkR1dj89QRt0LbRZqbNOpVi2G9qHus1VzW1nAe gRwB5HON3GUbsnt9B+XZkXkyOU+UJFI3o+1XO+80DWBrjDlhvRs2V6jXDeeKc4e8Eljg AGkQ== X-Gm-Message-State: ANoB5plkigErQ7XQQELuFCksPOycvaacq6gsDfFOgTAnLwt34BK2kmFC MXe1fXVJa1bTEsOUTuHE0mkbeJWGb71rpQ== 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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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?1749711675418360731?= X-GMAIL-MSGID: =?utf-8?q?1749711675418360731?= 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: 21395 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp189794wrr; Wed, 16 Nov 2022 19:19:15 -0800 (PST) X-Google-Smtp-Source: AA0mqf7dbTKJ3DJQFZ7RU3Ddyn5ryAYHDMR9AJsj6pUAjfId3rCu5xmcqKXu8oo8zENIHqrZNG2M X-Received: by 2002:a17:903:c5:b0:188:bb79:4892 with SMTP id x5-20020a17090300c500b00188bb794892mr874326plc.60.1668655154903; Wed, 16 Nov 2022 19:19:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668655154; cv=none; d=google.com; s=arc-20160816; b=twBBVAbFC7mzG5P9U/EtujJNOn+spJX1i/gDVribCUJOziUAGQaQ2kBraoajMbRTHT HtTJQAMGeajQ3lSVom4qmS6v3alM/iNJKgRnqcBg17wSmXBLhqD/m/RO9JEiYZiT5MAH 802usiRiJoI1fPVE63DPgvpgPOvTdsL9yv3jlR85HQtrAkLcTmrv4AUTjFA9fClqwYQt N1lb3O0vnMkBkyNgZ7rSJeHFni3sHTR3MvMmbvPDIUqLhYS49URUJy/Q9F+B7JCoojqS C8S9O1jWBN/EOkmjjCm115DJ0/06tcEzjE2zwjRvirGVYxdgqlrY5dzeyN8Zmvns4tOa OwiA== 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=X9LBEXDD+Ph4SF0Q02heQyIynGLkO+luTsSJyIxQLi8=; b=apa+VmOBcMaH1ngRByUqgIJ0PxUYCBnP6It61yZDliZe4fIdKRT2xUnt9F3hKxvwqu C1tUPopJFQV7NwrhJV54494qO/1r4eoXuAqIi6ridjBL2Gf7/yuL1D6fvWgjcPmDSWIJ tOW6Q5VfayFaVht1I1AcJHwdzrru7UX7dOrZ/ygkM+6MgA9xQN7txy5+tZDAfkWGyUhs kdWEdjdsHC1HjvA7ZfFkg0Y9j9AzbLFho1WJ96mizBvM48gma2RMKUyxkbPkhvYJogQS nUCk2rT78aCNZRzUZBjzqI//sJwzDH4mSTwghCMHfPdaOVT7oGoWRcDcb6rK85rdh5kJ XhuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=JHB8aiQg; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t10-20020a63f34a000000b00476cd35390esi1352874pgj.238.2022.11.16.19.19.01; Wed, 16 Nov 2022 19:19: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=@joelfernandes.org header.s=google header.b=JHB8aiQg; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234040AbiKQDQR (ORCPT + 99 others); Wed, 16 Nov 2022 22:16:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234364AbiKQDQH (ORCPT ); Wed, 16 Nov 2022 22:16:07 -0500 Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 950C564A31 for ; Wed, 16 Nov 2022 19:16:06 -0800 (PST) Received: by mail-qt1-x831.google.com with SMTP id w9so359114qtv.13 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=o2ac17Kkt0TI3hKWKjlTBQCYic08ZszD60V1t7Y691kMYA99K4VybgwqgytQ0Aalj7 D6FbaiIfjS2gYRwcjwXDbkUVNJnxtq/+gKtjwY8cSxCCc/QZhe8ThGfC4Ca0SJtui1PB srYlbm7hq7jp0lDcKLoJUqkC7Qc/1HV08UNrVGsqAK1AHMBN7T/+eobp8hdMgjhzjXHf eipkUW+Qs/CttOReKXROb+s+HMy8l3VIeL4rfJObTnfvl9JWE7l9SNlVWxGj1SCoiOg8 sq/dNeBO7AZiGo8J1GHFgXcdcO8tVPHH258LX8z45/cEyMLD8Sgd40yHdFQaB4guSwpF j+lA== X-Gm-Message-State: ANoB5pn4qDQwFy5l8viiclN9P0Ks7gPB+BRrgbmGa0yGbH5hYPZL67hD /4s/XZnt7n8lI5LQOeZdH7kVgp1KZWrGKg== 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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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?1749711747723525932?= X-GMAIL-MSGID: =?utf-8?q?1749711747723525932?= 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);