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: <20240422105424.GM30852@noisy.programming.kicks-ass.net>
Date: Mon, 22 Apr 2024 12:54:24 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Mikulas Patocka <mpatocka@...hat.com>
Cc: Mike Snitzer <msnitzer@...hat.com>, Jens Axboe <axboe@...nel.dk>,
	Damien Le Moal <dlemoal@...nel.org>, Ingo Molnar <mingo@...hat.com>,
	Will Deacon <will@...nel.org>, Waiman Long <longman@...hat.com>,
	Guangwu Zhang <guazhang@...hat.com>, dm-devel@...ts.linux.dev,
	linux-block@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] completion: move blk_wait_io to
 kernel/sched/completion.c

On Wed, Apr 17, 2024 at 08:00:22PM +0200, Mikulas Patocka wrote:
> 
> 
> On Wed, 17 Apr 2024, Peter Zijlstra wrote:
> 
> > On Wed, Apr 17, 2024 at 07:49:17PM +0200, Mikulas Patocka wrote:
> > > Index: linux-2.6/kernel/sched/completion.c
> > > ===================================================================
> > > --- linux-2.6.orig/kernel/sched/completion.c	2024-04-17 19:41:14.000000000 +0200
> > > +++ linux-2.6/kernel/sched/completion.c	2024-04-17 19:41:14.000000000 +0200
> > > @@ -290,6 +290,26 @@ wait_for_completion_killable_timeout(str
> > >  EXPORT_SYMBOL(wait_for_completion_killable_timeout);
> > >  
> > >  /**
> > > + * wait_for_completion_long_io - waits for completion of a task
> > > + * @x:  holds the state of this particular completion
> > > + *
> > > + * This is like wait_for_completion_io, but it doesn't warn if the wait takes
> > > + * too long.
> > > + */
> > > +void wait_for_completion_long_io(struct completion *x)
> > > +{
> > > +	/* Prevent hang_check timer from firing at us during very long I/O */
> > > +	unsigned long timeout = sysctl_hung_task_timeout_secs * HZ / 2;
> > > +
> > > +	if (timeout)
> > > +		while (!wait_for_completion_io_timeout(x, timeout))
> > > +			;
> > > +	else
> > > +		wait_for_completion_io(x);
> > > +}
> > > +EXPORT_SYMBOL(wait_for_completion_long_io);
> > 
> > Urgh, why is it a sane thing to circumvent the hang check timer? 
> 
> The block layer already does it - the bios can have arbitrary size, so 
> waiting for them takes arbitrary time.

Yeah, but now you make it generic and your comment doesn't warn people
away, it makes them think this is a sane thing to do.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ