Re: page_launder() bug

2001-05-07 Thread Linus Torvalds
On Mon, 7 May 2001, Marcelo Tosatti wrote: So what about moving the check for a dead swap cache page from swap_writepage() to page_launder() (+ PageSwapCache() check) just before the if (!launder_loop) ? Yes, its ugly special casing. Any other suggestion ? My most favourite approach

Re: page_launder() bug

2001-05-07 Thread Linus Torvalds
On Mon, 7 May 2001, David S. Miller wrote: Here, let's talk code a little bit so there are no misunderstandings, I really want to put this to rest: Calculate dead_swap_page outside of lock. NO. That's not what you're doing at all. You're calculating something completely different that

Re: page_launder() bug

2001-05-07 Thread Tobias Ringstrom
On Sun, 6 May 2001, David S. Miller wrote: It is the most straightforward way to make a '1' or '0' integer from the NULL state of a pointer. But is it really specified in the C standards to be exctly zero or one, and not zero and non-zero? IMHO, the ?: construct is way more readable and

Re: page_launder() bug

2001-05-07 Thread David S. Miller
Tobias Ringstrom writes: But is it really specified in the C standards to be exctly zero or one, and not zero and non-zero? I'm pretty sure it does. IMHO, the ?: construct is way more readable and reliable. Well identical code has been there for several months just a few lines away.

Re: page_launder() bug

2001-05-07 Thread Helge Hafting
Tobias Ringstrom wrote: On Sun, 6 May 2001, David S. Miller wrote: It is the most straightforward way to make a '1' or '0' integer from the NULL state of a pointer. But is it really specified in the C standards to be exctly zero or one, and not zero and non-zero? !0 is 1. !(anything

Re: page_launder() bug

2001-05-07 Thread Alan Cox
It is the most straightforward way to make a '1' or '0' integer from the NULL state of a pointer. But is it really specified in the C standards to be exctly zero or one, and not zero and non-zero? Yes. (Fortunately since when this argument occurred Linus said he would eat his underpants

Re: page_launder() bug

2001-05-07 Thread H. Peter Anvin
Followup to: [EMAIL PROTECTED] By author:Tobias Ringstrom [EMAIL PROTECTED] In newsgroup: linux.dev.kernel On Sun, 6 May 2001, David S. Miller wrote: It is the most straightforward way to make a '1' or '0' integer from the NULL state of a pointer. But is it really specified in the C

Re: page_launder() bug

2001-05-07 Thread Linus Torvalds
In article [EMAIL PROTECTED], BERECZ Szabolcs [EMAIL PROTECTED] wrote: there is a bug in page_launder introduced with kernel 2.4.3-ac12. Yes. The whole dead_swap_page optimization in the -ac tree is apparentrly completely bogus. It caches a value that is not valid: you cannot reliably look

Re: page_launder() bug

2001-05-07 Thread J . A . Magallon
On 05.07 Helge Hafting wrote: Tobias Ringstrom wrote: On Sun, 6 May 2001, David S. Miller wrote: It is the most straightforward way to make a '1' or '0' integer from the NULL state of a pointer. But is it really specified in the C standards to be exctly zero or one, and not

Re: page_launder() bug

2001-05-07 Thread David S. Miller
Linus Torvalds writes: The whole dead_swap_page optimization in the -ac tree is apparentrly completely bogus. It caches a value that is not valid: you cannot reliably look at whether the page has buffers etc without holding the page locked. It caches a value controlling heuristics,

Re: page_launder() bug

2001-05-07 Thread Marcelo Tosatti
On 7 May 2001, Linus Torvalds wrote: But it is important to re-calculate the deadness after getting the lock. Before, it was just an informed guess. After the lock, it is knowledge. And you can use informed guesses for heuristics, but you must _not_ use them for any serious decisions. And

Re: page_launder() bug

2001-05-07 Thread Linus Torvalds
On Mon, 7 May 2001, Marcelo Tosatti wrote: On 7 May 2001, Linus Torvalds wrote: But it is important to re-calculate the deadness after getting the lock. Before, it was just an informed guess. After the lock, it is knowledge. And you can use informed guesses for heuristics, but you

Re: page_launder() bug

2001-05-07 Thread Marcelo Tosatti
On Mon, 7 May 2001, Linus Torvalds wrote: On Mon, 7 May 2001, Marcelo Tosatti wrote: On 7 May 2001, Linus Torvalds wrote: But it is important to re-calculate the deadness after getting the lock. Before, it was just an informed guess. After the lock, it is knowledge. And you

Re: page_launder() bug

2001-05-07 Thread Linus Torvalds
On Mon, 7 May 2001, Marcelo Tosatti wrote: So the dead_swap_page logic is _not_ buggy and you are full of shit when telling Alan to revert the change. (sorry, I could not avoid this one) Well, the problem is that the patch _is_ buggy. swap_writepage() does it right. And dead_swap_page

Re: page_launder() bug

2001-05-07 Thread Marcelo Tosatti
On Mon, 7 May 2001, Linus Torvalds wrote: On Mon, 7 May 2001, Marcelo Tosatti wrote: So the dead_swap_page logic is _not_ buggy and you are full of shit when telling Alan to revert the change. (sorry, I could not avoid this one) Well, the problem is that the patch _is_ buggy.

Re: page_launder() bug

2001-05-07 Thread Linus Torvalds
On Mon, 7 May 2001, Marcelo Tosatti wrote: So lets fix it and make it look for the swap counts. Ehh. Which you MUST NOT do without holding the page lock. Hint: it needs page-index, and without holding the page lock you don't know what it could be. An out-of-bounds page index could do

Re: page_launder() bug

2001-05-07 Thread Linus Torvalds
On Mon, 7 May 2001, David S. Miller wrote: Marcelo Tosatti writes: I just thought about this case: We find a dead swap cache page, so dead_swap_page goes to 1. We call swap_writepage(), but in the meantime the swapin readahead code got a reference on the swap map for

Re: page_launder() bug

2001-05-07 Thread Marcelo Tosatti
On Mon, 7 May 2001, David S. Miller wrote: Marcelo Tosatti writes: I just thought about this case: We find a dead swap cache page, so dead_swap_page goes to 1. We call swap_writepage(), but in the meantime the swapin readahead code got a reference on the swap map for

Re: page_launder() bug

2001-05-07 Thread Linus Torvalds
On Mon, 7 May 2001, David S. Miller wrote: Marcelo Tosatti writes: I was wrong. The patch is indeed buggy because of the __GFP_IO thing. What about the __GFP_IO thing? Specifically, what protects the __GFP_IO thing from happening without my patch? This: /*

Re: page_launder() bug

2001-05-06 Thread Aaron Lehmann
On Sun, May 06, 2001 at 09:55:26PM -0700, David S. Miller wrote: > > Jonathan Morton writes: > > >- page_count(page) == (1 + !!page->buffers)); > > Two inversions in a row? > It is the most straightforward way to make a '1' or '0' > integer from the NULL state of a pointer.

Re: page_launder() bug

2001-05-06 Thread David S. Miller
Jonathan Morton writes: > >-page_count(page) == (1 + !!page->buffers)); > > Two inversions in a row? It is the most straightforward way to make a '1' or '0' integer from the NULL state of a pointer. Later, David S. Miller [EMAIL PROTECTED] - To unsubscribe from this

Re: page_launder() bug

2001-05-06 Thread Jonathan Lundell
At 12:07 AM +0200 2001-05-07, BERECZ Szabolcs wrote: >On Sun, 6 May 2001, Jonathan Morton wrote: > > > >- page_count(page) == (1 + !!page->buffers)); >> >> Two inversions in a row? I'd like to see that made more explicit, >> otherwise it looks like a bug to me. Of course, if

Re: page_launder() bug

2001-05-06 Thread BERECZ Szabolcs
Hi! On Sun, 6 May 2001, Jonathan Morton wrote: > >- page_count(page) == (1 + !!page->buffers)); > > Two inversions in a row? I'd like to see that made more explicit, > otherwise it looks like a bug to me. Of course, if it IS a bug... it's not a bug. if page->buffers is

Re: page_launder() bug

2001-05-06 Thread Jonathan Morton
>- page_count(page) == (1 + !!page->buffers)); Two inversions in a row? I'd like to see that made more explicit, otherwise it looks like a bug to me. Of course, if it IS a bug... -- from: Jonathan

page_launder() bug

2001-05-06 Thread BERECZ Szabolcs
Hi! there is a bug in page_launder introduced with kernel 2.4.3-ac12. if the swapfile is on a filesystem, then after swapping out some pages, the system locks up. sometimes it writes an oops message. I don't know exactly what's the problem, but with the attached patch it works. (this is just a

page_launder() bug

2001-05-06 Thread BERECZ Szabolcs
Hi! there is a bug in page_launder introduced with kernel 2.4.3-ac12. if the swapfile is on a filesystem, then after swapping out some pages, the system locks up. sometimes it writes an oops message. I don't know exactly what's the problem, but with the attached patch it works. (this is just a

Re: page_launder() bug

2001-05-06 Thread Jonathan Morton
- page_count(page) == (1 + !!page-buffers)); Two inversions in a row? I'd like to see that made more explicit, otherwise it looks like a bug to me. Of course, if it IS a bug... -- from: Jonathan Chromatix

Re: page_launder() bug

2001-05-06 Thread BERECZ Szabolcs
Hi! On Sun, 6 May 2001, Jonathan Morton wrote: - page_count(page) == (1 + !!page-buffers)); Two inversions in a row? I'd like to see that made more explicit, otherwise it looks like a bug to me. Of course, if it IS a bug... it's not a bug. if page-buffers is zero, than

Re: page_launder() bug

2001-05-06 Thread Jonathan Lundell
At 12:07 AM +0200 2001-05-07, BERECZ Szabolcs wrote: On Sun, 6 May 2001, Jonathan Morton wrote: - page_count(page) == (1 + !!page-buffers)); Two inversions in a row? I'd like to see that made more explicit, otherwise it looks like a bug to me. Of course, if it IS a

Re: page_launder() bug

2001-05-06 Thread David S. Miller
Jonathan Morton writes: -page_count(page) == (1 + !!page-buffers)); Two inversions in a row? It is the most straightforward way to make a '1' or '0' integer from the NULL state of a pointer. Later, David S. Miller [EMAIL PROTECTED] - To unsubscribe from this list:

Re: page_launder() bug

2001-05-06 Thread Aaron Lehmann
On Sun, May 06, 2001 at 09:55:26PM -0700, David S. Miller wrote: Jonathan Morton writes: - page_count(page) == (1 + !!page-buffers)); Two inversions in a row? It is the most straightforward way to make a '1' or '0' integer from the NULL state of a pointer.

<    1   2