Netdev List
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Eric Dumazet <edumazet@google.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, eric.dumazet@gmail.com,
	Jiri Pirko <jiri@nvidia.com>
Subject: Re: [PATCH net] netdevsim: use cond_resched() in nsim_dev_trap_report_work()
Date: Fri, 11 Oct 2024 08:59:11 -0700	[thread overview]
Message-ID: <20241011085911.601bad62@kernel.org> (raw)
In-Reply-To: <20241011131843.2931995-1-edumazet@google.com>

On Fri, 11 Oct 2024 13:18:43 +0000 Eric Dumazet wrote:
> --- a/drivers/net/netdevsim/dev.c
> +++ b/drivers/net/netdevsim/dev.c
> @@ -848,11 +848,12 @@ static void nsim_dev_trap_report_work(struct work_struct *work)
>  			continue;
>  
>  		nsim_dev_trap_report(nsim_dev_port);
> +		cond_resched();
>  	}
>  	devl_unlock(priv_to_devlink(nsim_dev));
> -
> -	schedule_delayed_work(&nsim_dev->trap_data->trap_report_dw,
> -			      msecs_to_jiffies(NSIM_TRAP_REPORT_INTERVAL_MS));
> +	queue_delayed_work(system_unbound_wq,
> +			   &nsim_dev->trap_data->trap_report_dw,
> +			   msecs_to_jiffies(NSIM_TRAP_REPORT_INTERVAL_MS));

Makes sense, there's one more place which queues this work, in case we
couldn't grab the lock. Should it also be converted?

  reply	other threads:[~2024-10-11 15:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-11 13:18 [PATCH net] netdevsim: use cond_resched() in nsim_dev_trap_report_work() Eric Dumazet
2024-10-11 15:59 ` Jakub Kicinski [this message]
2024-10-11 16:01   ` Eric Dumazet

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=20241011085911.601bad62@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=jiri@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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