public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [patch] disable READA
  2002-07-30 21:25 [patch] disable READA Andrew Morton
@ 2002-07-30 20:40 ` Marcelo Tosatti
  2002-07-30 20:44   ` Marcelo Tosatti
  2002-07-30 21:43 ` Jeff Garzik
  1 sibling, 1 reply; 4+ messages in thread
From: Marcelo Tosatti @ 2002-07-30 20:40 UTC (permalink / raw)
  To: Andrew Morton; +Cc: lkml, Andrea Arcangeli


Who is using READA this days ?


On Tue, 30 Jul 2002, Andrew Morton wrote:

>
> There's a bug in bread() which can cause it to misinterpret a
> failed READA request as an IO error on SMP.
>
> If a filesytem block is subject to READA and __make_request()
> decides that the request would block then __make_request()
> will (via end_buffer_io_sync) mark the buffer as not uptodate
> and will unlock it.
>
> But if another CPU attempts to bread() the same buffer at the same
> time, the following happens:
>
> 1: ll_rw_block() sees the buffer is locked and does nothing at all
>
> 2: bread() does a wait_on_buffer()
>
> 3: the other CPU (the one doing READA) unlocks the non uptodate buffer
>
> 4: bread() sees the buffer come unlocked.  It's not uptodate, so
>    bread() bogusly reports an IO error.
>
> I haven't seen it in the wild, because it is rare to get that
> much read I/O in flight.  reiserfs and ext3 (at least) use READA.
>
> An appropriate fix for 2.4 is to disable READA.
>
>
>  ll_rw_blk.c |    2 ++
>  1 files changed, 2 insertions
>
> --- 2.4.19-rc3/drivers/block/ll_rw_blk.c~no-readahead	Tue Jul 30 14:18:17 2002
> +++ 2.4.19-rc3-akpm/drivers/block/ll_rw_blk.c	Tue Jul 30 14:19:52 2002
> @@ -841,7 +841,9 @@ static int __make_request(request_queue_
>  	rw_ahead = 0;	/* normal case; gets changed below for READA */
>  	switch (rw) {
>  		case READA:
> +#if 0	/* bread() misinterprets failed READA attempts as IO errors on SMP */
>  			rw_ahead = 1;
> +#endif
>  			rw = READ;	/* drop into READ */
>  		case READ:
>  		case WRITE:
>
> .
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] disable READA
  2002-07-30 20:40 ` Marcelo Tosatti
@ 2002-07-30 20:44   ` Marcelo Tosatti
  0 siblings, 0 replies; 4+ messages in thread
From: Marcelo Tosatti @ 2002-07-30 20:44 UTC (permalink / raw)
  To: Andrew Morton; +Cc: lkml, Andrea Arcangeli


Ah, haven't read the full message.

Forget about my question. :)

On Tue, 30 Jul 2002, Marcelo Tosatti wrote:

>
> Who is using READA this days ?
>
>
> On Tue, 30 Jul 2002, Andrew Morton wrote:
>
> >
> > There's a bug in bread() which can cause it to misinterpret a
> > failed READA request as an IO error on SMP.
> >
> > If a filesytem block is subject to READA and __make_request()
> > decides that the request would block then __make_request()
> > will (via end_buffer_io_sync) mark the buffer as not uptodate
> > and will unlock it.
> >
> > But if another CPU attempts to bread() the same buffer at the same
> > time, the following happens:
> >
> > 1: ll_rw_block() sees the buffer is locked and does nothing at all
> >
> > 2: bread() does a wait_on_buffer()
> >
> > 3: the other CPU (the one doing READA) unlocks the non uptodate buffer
> >
> > 4: bread() sees the buffer come unlocked.  It's not uptodate, so
> >    bread() bogusly reports an IO error.
> >
> > I haven't seen it in the wild, because it is rare to get that
> > much read I/O in flight.  reiserfs and ext3 (at least) use READA.
> >
> > An appropriate fix for 2.4 is to disable READA.
> >
> >
> >  ll_rw_blk.c |    2 ++
> >  1 files changed, 2 insertions
> >
> > --- 2.4.19-rc3/drivers/block/ll_rw_blk.c~no-readahead	Tue Jul 30 14:18:17 2002
> > +++ 2.4.19-rc3-akpm/drivers/block/ll_rw_blk.c	Tue Jul 30 14:19:52 2002
> > @@ -841,7 +841,9 @@ static int __make_request(request_queue_
> >  	rw_ahead = 0;	/* normal case; gets changed below for READA */
> >  	switch (rw) {
> >  		case READA:
> > +#if 0	/* bread() misinterprets failed READA attempts as IO errors on SMP */
> >  			rw_ahead = 1;
> > +#endif
> >  			rw = READ;	/* drop into READ */
> >  		case READ:
> >  		case WRITE:


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [patch] disable READA
@ 2002-07-30 21:25 Andrew Morton
  2002-07-30 20:40 ` Marcelo Tosatti
  2002-07-30 21:43 ` Jeff Garzik
  0 siblings, 2 replies; 4+ messages in thread
From: Andrew Morton @ 2002-07-30 21:25 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: lkml, Andrea Arcangeli


There's a bug in bread() which can cause it to misinterpret a
failed READA request as an IO error on SMP.

If a filesytem block is subject to READA and __make_request()
decides that the request would block then __make_request()
will (via end_buffer_io_sync) mark the buffer as not uptodate
and will unlock it.

But if another CPU attempts to bread() the same buffer at the same
time, the following happens:

1: ll_rw_block() sees the buffer is locked and does nothing at all

2: bread() does a wait_on_buffer()

3: the other CPU (the one doing READA) unlocks the non uptodate buffer

4: bread() sees the buffer come unlocked.  It's not uptodate, so
   bread() bogusly reports an IO error.

I haven't seen it in the wild, because it is rare to get that 
much read I/O in flight.  reiserfs and ext3 (at least) use READA.

An appropriate fix for 2.4 is to disable READA.


 ll_rw_blk.c |    2 ++
 1 files changed, 2 insertions

--- 2.4.19-rc3/drivers/block/ll_rw_blk.c~no-readahead	Tue Jul 30 14:18:17 2002
+++ 2.4.19-rc3-akpm/drivers/block/ll_rw_blk.c	Tue Jul 30 14:19:52 2002
@@ -841,7 +841,9 @@ static int __make_request(request_queue_
 	rw_ahead = 0;	/* normal case; gets changed below for READA */
 	switch (rw) {
 		case READA:
+#if 0	/* bread() misinterprets failed READA attempts as IO errors on SMP */
 			rw_ahead = 1;
+#endif
 			rw = READ;	/* drop into READ */
 		case READ:
 		case WRITE:

.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] disable READA
  2002-07-30 21:25 [patch] disable READA Andrew Morton
  2002-07-30 20:40 ` Marcelo Tosatti
@ 2002-07-30 21:43 ` Jeff Garzik
  1 sibling, 0 replies; 4+ messages in thread
From: Jeff Garzik @ 2002-07-30 21:43 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Marcelo Tosatti, lkml, Andrea Arcangeli

Andrew Morton wrote:
> There's a bug in bread() which can cause it to misinterpret a
> failed READA request as an IO error on SMP.


> --- 2.4.19-rc3/drivers/block/ll_rw_blk.c~no-readahead	Tue Jul 30 14:18:17 2002
> +++ 2.4.19-rc3-akpm/drivers/block/ll_rw_blk.c	Tue Jul 30 14:19:52 2002
> @@ -841,7 +841,9 @@ static int __make_request(request_queue_
>  	rw_ahead = 0;	/* normal case; gets changed below for READA */
>  	switch (rw) {
>  		case READA:
> +#if 0	/* bread() misinterprets failed READA attempts as IO errors on SMP */
>  			rw_ahead = 1;
> +#endif



If the problem is only on SMP, then that should be #ifndef CONFIG_SMP...

	Jeff




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-07-30 21:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-30 21:25 [patch] disable READA Andrew Morton
2002-07-30 20:40 ` Marcelo Tosatti
2002-07-30 20:44   ` Marcelo Tosatti
2002-07-30 21:43 ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox