linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Andrew Morton <akpm@osdl.org>,
	Linux Memory Management <linux-mm@kvack.org>,
	Linus Torvalds <torvalds@osdl.org>
Subject: Re: [PATCH 2/3] higher order watermarks
Date: Thu, 4 Nov 2004 20:47:51 -0200	[thread overview]
Message-ID: <20041104224751.GA13679@logos.cnet> (raw)
In-Reply-To: <418AD20D.4000201@yahoo.com.au>

On Fri, Nov 05, 2004 at 12:06:21PM +1100, Nick Piggin wrote:
> Marcelo Tosatti wrote:
> >Hi Nick!
> >
> >On Thu, Nov 04, 2004 at 11:20:54PM +1100, Nick Piggin wrote:
> >
> 
> >>So now what we need to do in order to calculate, say the amount of memory
> >>that will satisfy order-2 *and above* (this is important) is the 
> >>following:
> >>
> >>	z->free_pages - (order[0].nr_free << 0) - (order[1].nr_free << 1)
> >
> >
> >Shouldnt that be then
> >
> >free_pages -= z->free_area[o].nr_free << o;
> >
> >instead of the current 
> >
> >free_pages -= z->free_area[order].nr_free << o;
> >
> >No?
> >
> 
> Yes, you're absolutely right. Sorry, this is what you were getting
> at all along :P
> 
> >
> >>to find order-3 and above, you also need to subtract (order[2].nr_free << 
> >>2).
> >>
> >>I quite liked this method because it has progressively less cost on lower
> >>order allocations, and for order-0 we don't need to do any calculation.
> >
> >
> >OK, now I get it. The only think which bugs me is the multiplication of 
> >values with different meanings.
> >
> 
> Yeah it's wrong, of course. Good catch, thanks.
> 
> If you would care to send a patch Marcelo? I don't have a recent
> -mm on hand at the moment. Would that be alright?

Sure, I'll prepare a patch. 

This typo probably means that the current code is not actually working as 
intented - did any of you receive any feedback on this patch, wrt high order allocation
intensive driver setup/workload, Nick and Andrew? 

I have been using a simple module which allocates a big number of high order
allocations in a row (for the defragmentation code testing), I'll give it a
shot tomorrow to test Nick's high-order-kswapd scheme effectiveness. 

Anyway, here is the patch:

Description:
Fix typo in Nick's kswapd-high-order awareness patch

--- linux-2.6.10-rc1-mm2/mm/page_alloc.c.orig	2004-11-04 22:52:00.505365136 -0200
+++ linux-2.6.10-rc1-mm2/mm/page_alloc.c	2004-11-04 22:52:03.121967352 -0200
@@ -733,7 +733,7 @@
 		return 0;
 	for (o = 0; o < order; o++) {
 		/* At the next order, this order's pages become unavailable */
-		free_pages -= z->free_area[order].nr_free << o;
+		free_pages -= z->free_area[o].nr_free << o;
 
 		/* Require fewer higher order pages to be free */
 		min >>= 1;
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

  reply	other threads:[~2004-11-04 22:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-27  8:00 [PATCH 0/3] teach kswapd about higher order allocations Nick Piggin
2004-10-27  8:00 ` [PATCH 1/3] keep count of free areas Nick Piggin
2004-10-27  8:02   ` [PATCH 2/3] higher order watermarks Nick Piggin
2004-10-27  8:02     ` [PATCH 3/3] teach kswapd about higher order areas Nick Piggin
2004-10-27  8:13       ` Nick Piggin
2004-11-04  8:57     ` [PATCH 2/3] higher order watermarks Marcelo Tosatti
2004-11-04 12:20       ` Nick Piggin
2004-11-04  9:55         ` Marcelo Tosatti
2004-11-05  1:06           ` Nick Piggin
2004-11-04 22:47             ` Marcelo Tosatti [this message]
2004-11-05  2:08               ` Andrew Morton
2004-11-05  2:14               ` Nick Piggin
2004-11-04 10:02         ` Marcelo Tosatti
2004-11-05  1:12           ` Nick Piggin
2004-11-10 16:23       ` Marcelo Tosatti
2004-11-11  1:41         ` Nick Piggin
2004-11-11 10:18           ` Marcelo Tosatti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041104224751.GA13679@logos.cnet \
    --to=marcelo.tosatti@cyclades.com \
    --cc=akpm@osdl.org \
    --cc=linux-mm@kvack.org \
    --cc=nickpiggin@yahoo.com.au \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox