public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* aa-160-lru_release_check
@ 2002-03-20  4:01 Andrew Morton
  2002-03-20 16:09 ` aa-160-lru_release_check Adrian Bunk
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Morton @ 2002-03-20  4:01 UTC (permalink / raw)
  To: lkml



Hugh's much-discussed check for releasing pages which are still on the LRU.


=====================================

--- 2.4.19-pre3/mm/page_alloc.c~aa-160-lru_release_check	Tue Mar 19 19:49:02 2002
+++ 2.4.19-pre3-akpm/mm/page_alloc.c	Tue Mar 19 19:49:02 2002
@@ -102,8 +102,11 @@ static void __free_pages_ok (struct page
 	/* Yes, think what happens when other parts of the kernel take 
 	 * a reference to a page in order to pin it for io. -ben
 	 */
-	if (PageLRU(page))
+	if (PageLRU(page)) {
+		if (unlikely(in_interrupt()))
+			BUG();
 		lru_cache_del(page);
+	}
 
 	if (page->buffers)
 		BUG();

-

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

* Re: aa-160-lru_release_check
  2002-03-20  4:01 aa-160-lru_release_check Andrew Morton
@ 2002-03-20 16:09 ` Adrian Bunk
  2002-03-20 19:16   ` aa-160-lru_release_check Mike Fedyk
  2002-03-20 19:28   ` aa-160-lru_release_check Andrew Morton
  0 siblings, 2 replies; 7+ messages in thread
From: Adrian Bunk @ 2002-03-20 16:09 UTC (permalink / raw)
  To: Andrew Morton; +Cc: lkml

On Tue, 19 Mar 2002, Andrew Morton wrote:

>...
> +		if (unlikely(in_interrupt()))
> +			BUG();
>...

Is there a reason against intruducing BUG_ON in 2.4? It makes such things
more readable.

cu
Adrian



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

* Re: aa-160-lru_release_check
  2002-03-20 16:09 ` aa-160-lru_release_check Adrian Bunk
@ 2002-03-20 19:16   ` Mike Fedyk
  2002-03-20 19:28   ` aa-160-lru_release_check Andrew Morton
  1 sibling, 0 replies; 7+ messages in thread
From: Mike Fedyk @ 2002-03-20 19:16 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Andrew Morton, lkml

On Wed, Mar 20, 2002 at 05:09:32PM +0100, Adrian Bunk wrote:
> On Tue, 19 Mar 2002, Andrew Morton wrote:
> 
> >...
> > +		if (unlikely(in_interrupt()))
> > +			BUG();
> >...
> 
> Is there a reason against intruducing BUG_ON in 2.4? It makes such things
> more readable.
> 

I think there are plans to do so...

... But not in this patch.

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

* Re: aa-160-lru_release_check
  2002-03-20 16:09 ` aa-160-lru_release_check Adrian Bunk
  2002-03-20 19:16   ` aa-160-lru_release_check Mike Fedyk
@ 2002-03-20 19:28   ` Andrew Morton
  2002-03-20 19:38     ` aa-160-lru_release_check Jeff Garzik
                       ` (2 more replies)
  1 sibling, 3 replies; 7+ messages in thread
From: Andrew Morton @ 2002-03-20 19:28 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: lkml

Adrian Bunk wrote:
> 
> On Tue, 19 Mar 2002, Andrew Morton wrote:
> 
> >...
> > +             if (unlikely(in_interrupt()))
> > +                     BUG();
> >...
> 
> Is there a reason against intruducing BUG_ON in 2.4? It makes such things
> more readable.
> 

I hate BUG_ON() :)  It's arse-about so you have to stare at it furiously
to understand why your kernel still works.

I hope the Nobel committee is reading this mailing list: how
about assert()?

-

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

* Re: aa-160-lru_release_check
  2002-03-20 19:28   ` aa-160-lru_release_check Andrew Morton
@ 2002-03-20 19:38     ` Jeff Garzik
  2002-03-20 20:02     ` aa-160-lru_release_check Dave Jones
  2002-03-20 20:42     ` aa-160-lru_release_check Robert Love
  2 siblings, 0 replies; 7+ messages in thread
From: Jeff Garzik @ 2002-03-20 19:38 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Adrian Bunk, lkml

Andrew Morton wrote:

>I hate BUG_ON() :)  It's arse-about so you have to stare at it furiously
>to understand why your kernel still works.
>
>I hope the Nobel committee is reading this mailing list: how
>about assert()?
>

I vote 'aye'

It's the same thing just in another name.

I would call it kassert or fixup existing places that use 'assert' 
first, though.

    Jeff





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

* Re: aa-160-lru_release_check
  2002-03-20 19:28   ` aa-160-lru_release_check Andrew Morton
  2002-03-20 19:38     ` aa-160-lru_release_check Jeff Garzik
@ 2002-03-20 20:02     ` Dave Jones
  2002-03-20 20:42     ` aa-160-lru_release_check Robert Love
  2 siblings, 0 replies; 7+ messages in thread
From: Dave Jones @ 2002-03-20 20:02 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Adrian Bunk, lkml

On Wed, Mar 20, 2002 at 11:28:36AM -0800, Andrew Morton wrote:
 > > Is there a reason against intruducing BUG_ON in 2.4? It makes such things
 > > more readable.
 > I hate BUG_ON() :)  It's arse-about so you have to stare at it furiously
 > to understand why your kernel still works.

 Preach on brother Morton.
 
 > I hope the Nobel committee is reading this mailing list: how
 > about assert()?

 Quite a few places in the kernel already are.
 See drivers/net/pci-skeleton.c for one.

-- 
| Dave Jones.        http://www.codemonkey.org.uk
| SuSE Labs

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

* Re: aa-160-lru_release_check
  2002-03-20 19:28   ` aa-160-lru_release_check Andrew Morton
  2002-03-20 19:38     ` aa-160-lru_release_check Jeff Garzik
  2002-03-20 20:02     ` aa-160-lru_release_check Dave Jones
@ 2002-03-20 20:42     ` Robert Love
  2 siblings, 0 replies; 7+ messages in thread
From: Robert Love @ 2002-03-20 20:42 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Adrian Bunk, lkml

On Wed, 2002-03-20 at 14:28, Andrew Morton wrote:
 
> I hate BUG_ON() :)  It's arse-about so you have to stare at it furiously
> to understand why your kernel still works.
> 
> I hope the Nobel committee is reading this mailing list: how
> about assert()?

I have a patch that introduces BUG_ON for 2.4.  I like the idea of
BUG_ON and it is certainly a place where the unlikely bit is useful. 
I've posted the patch here before; I was going to do so again against
the next 2.4-pre.

Further, and most importantly, the patch provides compatibility with 2.5
code that uses it.  I have no problems naming BUG_ON anything anyone
wants (Jeff's suggestion of kassert seems sane) but we should then do
the proper renaming in 2.5.

	Robert Love


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

end of thread, other threads:[~2002-03-20 20:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-03-20  4:01 aa-160-lru_release_check Andrew Morton
2002-03-20 16:09 ` aa-160-lru_release_check Adrian Bunk
2002-03-20 19:16   ` aa-160-lru_release_check Mike Fedyk
2002-03-20 19:28   ` aa-160-lru_release_check Andrew Morton
2002-03-20 19:38     ` aa-160-lru_release_check Jeff Garzik
2002-03-20 20:02     ` aa-160-lru_release_check Dave Jones
2002-03-20 20:42     ` aa-160-lru_release_check Robert Love

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