lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y90ZnFNT+4XS2PlH@alley>
Date:   Fri, 3 Feb 2023 15:26:36 +0100
From:   Petr Mladek <pmladek@...e.com>
To:     Tejun Heo <tj@...nel.org>
Cc:     Lai Jiangshan <jiangshanlai@...il.com>,
        Michal Koutny <mkoutny@...e.com>, linux-kernel@...r.kernel.org
Subject: Re: [RFC 5/5] workqueue: Print backtraces from CPUs with hung CPU
 bound workqueues

Hello,

On Thu 2023-02-02 13:45:05, Tejun Heo wrote:
> > +static bool show_pool_suspicious_workers(struct worker_pool *pool, bool shown_title)
> > +{
> > +	bool shown_any = false;
> > +	struct worker *worker;
> > +	unsigned long flags;
> > +	int bkt;
> > +
> > +	raw_spin_lock_irqsave(&pool->lock, flags);
> > +
> > +	if (pool->cpu < 0)
> > +		goto out;
> 
> This can be tested before grabbling the lock.

I see.

> > +	if (!per_cpu(wq_watchdog_hung_cpu, pool->cpu))
> > +		goto out;
> 
> Given that the state is per-pool, would it make sense to mark this on the
> pool instead?

Makes sense. I think that I started with the per-CPU variable before
I sorted my thoughts about what backtraces were useful ;-)

> > +	if (list_empty(&pool->worklist))
> > +		goto out;
> 
> This condition isn't really necessary, right?

IMHO, it should be there. The watchdog reports the problem only when
there  are pending work items, see

		if (list_empty(&pool->worklist))
			continue;

in wq_watchdog_timer_fn().

My understanding is that it is OK to process work items longer
time when they are sleeping and waiting for something.

Best Regards,
Petr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ