Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1142891rdb; Wed, 6 Dec 2023 09:39:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IGOS61d/eK0YTTzIzjL4yXbTw5u34biYpglaMKkCjpCMYin8kvWB5/w9MLroCGumEek6mmX X-Received: by 2002:a17:90a:a795:b0:286:a502:dfe2 with SMTP id f21-20020a17090aa79500b00286a502dfe2mr1342617pjq.52.1701884370087; Wed, 06 Dec 2023 09:39:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701884370; cv=none; d=google.com; s=arc-20160816; b=ZmVMp66yHwb8hycuHMi+9MnQX3aBet1/eQw7DFba+gjAJDutP7SlgiRDKOeVJSU6Q4 gx+05jd/MUUpjOJBPbK53CByyAJJ23/wlx/upFs4HFGwSkhlf/8cIIeXL63HwQjGf+5O 7FeazHrtNqTba6/V+b7dJ27+NZ8Q6Jn0zFlgxapfCz78QTyhQgLBg9Z8mkTCucQK5BZg PRqVUnlraki7IMzbkvqhKRWqK3xFZH7KglCJ016F0k3L4ogJ96uHM/RON+6MAz0Zk7gD wb1SKIw0zcx0fLGCnwK/AwiEw6BiyVm+DE3D86pZdbsziQs3I7xJrDRuRhXbELk+16Sm xjIg== 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:subject:cc:to:from:date :dkim-signature; bh=epEPAoODqaSsyq6mWAsXlk/zwY3UQrTT5iMw4+zTkgU=; fh=lwpgkX/3f6cVQETvUtBGdI67tD6vFkzLsm4J9Kci8Pc=; b=r5nnID1PQuTYiJYBiJb+B1/npZ5DhqrJ8Qb2XwAS7o1yTNLerVMArwsLDDjNAmoDrw lzZyZmrM/qN/QzQJvWCZ7EWJ4mpxGv1mSkWSJpPgFnWBH9L5KwSyv4iXqq42TGETrTHy /PYy3fkbSiRzaZym61hbKKdZlzPxH5j97JtlQ6+rnT1jrQfoAL0cP7ICSP7xP+BoJVUj smXczRFjF6sSS3SGUzjkNUkbc3DBDjyONxfyx6Uur70J0WSvUeRVPwJXkkcPWVIdzp5+ pSWf8IXFDEKSVKnxVMCSYN3XD3QXJTkGBaWCFWtIgfg9mvSNYWnzGyV9ST1F4qk+5r4A LgDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@networkplumber-org.20230601.gappssmtp.com header.s=20230601 header.b=G7LjdyIB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=networkplumber.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id w14-20020a17090a8a0e00b002867eb143afsi165233pjn.133.2023.12.06.09.39.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 09:39:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@networkplumber-org.20230601.gappssmtp.com header.s=20230601 header.b=G7LjdyIB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=networkplumber.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 1C8928026DF2; Wed, 6 Dec 2023 09:39:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442676AbjLFRjP (ORCPT + 99 others); Wed, 6 Dec 2023 12:39:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379728AbjLFRjO (ORCPT ); Wed, 6 Dec 2023 12:39:14 -0500 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6328D47 for ; Wed, 6 Dec 2023 09:39:20 -0800 (PST) Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1d08a924fcfso11285ad.2 for ; Wed, 06 Dec 2023 09:39:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1701884360; x=1702489160; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=epEPAoODqaSsyq6mWAsXlk/zwY3UQrTT5iMw4+zTkgU=; b=G7LjdyIBPxbsJPrlhEsc/+rcQEIDcADolRlDc0bxGGMoxV2At6voLXxW1WNg1sPigp ubDVSi4drL8F4IeGeN4cp7tKlL85UIPstQN+vSxODzRN8dQ/5WZeYyY4nqyPRkhxaVp8 3Om4T3p9ZrfI93wQVBqlH1w0yigioBPPlVtUMpALHSKtioytu53GIcjsLQtr0fsQsmr3 PxJCU90MYP02ZZ7aNCbhKM1/ju2pgzr+AEV7XqfNKMrW9PlvrgOPJQFJ/a4vrgOfpgd1 sy6cORbKKk5h8ygo1blZd440qABNaIyhZJmZNNKk8Iu8d6r/wdcEK0uHFvynwOQs1WEs Souw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701884360; x=1702489160; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=epEPAoODqaSsyq6mWAsXlk/zwY3UQrTT5iMw4+zTkgU=; b=mi/M2lA9ERVpyweqR9vhqvH6u/Z9ErhvQL8Ny09m86fbK/OQD9kPCLCDqyvtOwUTt6 GrsCYQcvz9tVDXnsp2ZRjNWd9Spmy6iG7SBZHnE8MiSFRuIWBDj1KaJ8SL5b5MaVLvJo 10ObycK5iA9P/pW1Y5zfnmUiQmJQmnM5SmfHWSTTMUEcO8djBzEIhUso/dnLlsJ4+04A B93Tz+/SLLjqjuxSL4F7PGjwPVrkIyot8uUO17K4ZMKNj/SqHlyT9V5Kh03KsrjQI54m 0x3Tm9u+KkqvgIB5f4RbhIHPlKFPTNtA2i+W/P3Shwzjgv75+5doJfT6oDFyXmV2ezul UDSA== X-Gm-Message-State: AOJu0YwzmvP8F90iTc7e3wbuW7JYh8r8Ow6D0gsfzXhJu3X97UG30JU6 xxl8yczRyOK1MKP7fivFMbKPkA== X-Received: by 2002:a17:902:8f8c:b0:1d0:6ffd:e2d7 with SMTP id z12-20020a1709028f8c00b001d06ffde2d7mr1069589plo.113.1701884360181; Wed, 06 Dec 2023 09:39:20 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id j5-20020a170902da8500b001cff353696asm81396plx.302.2023.12.06.09.39.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 09:39:19 -0800 (PST) Date: Wed, 6 Dec 2023 09:39:17 -0800 From: Stephen Hemminger To: Judy Hsiao Cc: Eric Dumazet , David Ahern , Simon Horman , Douglas Anderson , Brian Haley , "David S. Miller" , Jakub Kicinski , Joel Granados , Julian Anastasov , Leon Romanovsky , Paolo Abeni , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH v2] neighbour: Don't let neigh_forced_gc() disable preemption for long Message-ID: <20231206093917.04fd57b5@hermes.local> In-Reply-To: <20231206033913.1290566-1-judyhsiao@chromium.org> References: <20231206033913.1290566-1-judyhsiao@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 06 Dec 2023 09:39:28 -0800 (PST) On Wed, 6 Dec 2023 03:38:33 +0000 Judy Hsiao wrote: > diff --git a/net/core/neighbour.c b/net/core/neighbour.c > index df81c1f0a570..552719c3bbc3 100644 > --- a/net/core/neighbour.c > +++ b/net/core/neighbour.c > @@ -253,9 +253,11 @@ static int neigh_forced_gc(struct neigh_table *tbl) > { > int max_clean = atomic_read(&tbl->gc_entries) - > READ_ONCE(tbl->gc_thresh2); > + u64 tmax = ktime_get_ns() + NSEC_PER_MSEC; > unsigned long tref = jiffies - 5 * HZ; > struct neighbour *n, *tmp; > int shrunk = 0; > + int loop = 0; > > NEIGH_CACHE_STAT_INC(tbl, forced_gc_runs); > > @@ -278,11 +280,16 @@ static int neigh_forced_gc(struct neigh_table *tbl) > shrunk++; > if (shrunk >= max_clean) > break; > + if (++loop == 16) { Overall looks good. Minor comments: - loop count should probably be unsigned - the magic constant 16 should be a sysctl tuneable