public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@kernel.org>
To: Doug Anderson <dianders@chromium.org>
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	Judy Hsiao <judyhsiao@chromium.org>,
	Eric Dumazet <edumazet@google.com>,
	Simon Horman <horms@kernel.org>,
	Brian Haley <haleyb.dev@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Joel Granados <joel.granados@gmail.com>,
	Julian Anastasov <ja@ssi.bg>, Leon Romanovsky <leon@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH v2] neighbour: Don't let neigh_forced_gc() disable preemption for long
Date: Wed, 6 Dec 2023 12:15:36 -0700	[thread overview]
Message-ID: <e4823a44-33a9-4dbf-a39d-66ae256b903a@kernel.org> (raw)
In-Reply-To: <CAD=FV=UgPZoXsGTgLV_4X9x2hGTMouO3Tpe9_WkwhU7Bsvav2Q@mail.gmail.com>

On 12/6/23 11:49 AM, Doug Anderson wrote:
> Hi,
> 
> On Wed, Dec 6, 2023 at 9:51 AM David Ahern <dsahern@kernel.org> wrote:
>>
>> On 12/6/23 10:39 AM, Stephen Hemminger wrote:
>>> On Wed,  6 Dec 2023 03:38:33 +0000
>>> Judy Hsiao <judyhsiao@chromium.org> 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
>>
>> A tunable is needed here; the loop counter is just to keep the overhead
>> of the ktime_get_ns call in check.
> 
> From context, I'm going to assume you meant a tunable is _NOT_ needed here. ;-)
> 
> -Doug

yes, multitasking fail :-(

  reply	other threads:[~2023-12-06 19:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-06  3:38 [PATCH v2] neighbour: Don't let neigh_forced_gc() disable preemption for long Judy Hsiao
2023-12-06  3:43 ` David Ahern
2023-12-06  7:34 ` Eric Dumazet
2023-12-06 17:21 ` Doug Anderson
2023-12-06 17:39 ` Stephen Hemminger
2023-12-06 17:51   ` David Ahern
2023-12-06 18:49     ` Doug Anderson
2023-12-06 19:15       ` David Ahern [this message]
2023-12-08 10:50 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e4823a44-33a9-4dbf-a39d-66ae256b903a@kernel.org \
    --to=dsahern@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dianders@chromium.org \
    --cc=edumazet@google.com \
    --cc=haleyb.dev@gmail.com \
    --cc=horms@kernel.org \
    --cc=ja@ssi.bg \
    --cc=joel.granados@gmail.com \
    --cc=judyhsiao@chromium.org \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox