All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rohit Seth <rohit.seth@intel.com>
To: Paul Jackson <pj@sgi.com>
Cc: akpm@osdl.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH]: Clean up of __alloc_pages
Date: Mon, 31 Oct 2005 13:20:54 -0800	[thread overview]
Message-ID: <1130793655.4853.41.camel@akash.sc.intel.com> (raw)
In-Reply-To: <20051029184728.100e3058.pj@sgi.com>

On Sat, 2005-10-29 at 18:47 -0700, Paul Jackson wrote:
> A couple more items:
>  1) Lets try for a consistent use of type "gfp_t" for gfp_mask.
>  2) The can_try_harder flag values were driving me nuts.

Not sure why?  Let me see if some new values could better articulate the
meaning.  Currently if value is < 0 then don't check the watermarks.
When we do check for watermarks, then the value of 1 indicates that it
could go below minimum value.

>  3) The "inline" you added to buffered_rmqueue() blew up my compile.

I will remove the inline based on your and Nick emails.  Though my patch
had inline before the struct....

-static struct page *
-buffered_rmqueue(struct zone *zone, int order, gfp_t gfp_flags)
+static inline struct page *
+buffered_rmqueue(struct zone *zone, int order, gfp_t gfp_flags, int
replenish)

...so that shouldn't have caused any problem.

>  4) The return from try_to_free_pages() was put in "i" for no evident reason.

Will be fixed.

>  5) I have no clue what the replenish flag you added to buffered_rmqueue does.
> 

A bit futuristic.  Will need it when pcp allocations gets checked first
(as Nick also mentioned).  Will remove it for now.

> You patch has:
> > can_try_harder can have following 
> >  * values:
> >  * -1 => No need to check for the watermarks.
> >  *  0 => Don't go too low down in deeps below the low watermark (GFP_HIGH)
> >  *  1 => Go far below the low watermark.  See zone_watermark_ok (RT TASK)
> 
> Later on, you have an inequality test on this value:
> 	if ((can_try_harder >= 0)
> and a non-zero test:
> 	if (can_try_harder)

The last line is from zone_watermark_ok.  The first check is in
get_page_from_freelist.  There is no (can_try_harder) check for this
flag in that function.

> 
> That's three magic values, not even in increasing order of "how hard
> one should try", tested a couple of different ways that requires
> absorbing the complete details of the three values and their ordering
> before one can read the code.
> 




WARNING: multiple messages have this Message-ID (diff)
From: Rohit Seth <rohit.seth@intel.com>
To: Paul Jackson <pj@sgi.com>
Cc: akpm@osdl.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH]: Clean up of __alloc_pages
Date: Mon, 31 Oct 2005 13:20:54 -0800	[thread overview]
Message-ID: <1130793655.4853.41.camel@akash.sc.intel.com> (raw)
In-Reply-To: <20051029184728.100e3058.pj@sgi.com>

On Sat, 2005-10-29 at 18:47 -0700, Paul Jackson wrote:
> A couple more items:
>  1) Lets try for a consistent use of type "gfp_t" for gfp_mask.
>  2) The can_try_harder flag values were driving me nuts.

Not sure why?  Let me see if some new values could better articulate the
meaning.  Currently if value is < 0 then don't check the watermarks.
When we do check for watermarks, then the value of 1 indicates that it
could go below minimum value.

>  3) The "inline" you added to buffered_rmqueue() blew up my compile.

I will remove the inline based on your and Nick emails.  Though my patch
had inline before the struct....

-static struct page *
-buffered_rmqueue(struct zone *zone, int order, gfp_t gfp_flags)
+static inline struct page *
+buffered_rmqueue(struct zone *zone, int order, gfp_t gfp_flags, int
replenish)

...so that shouldn't have caused any problem.

>  4) The return from try_to_free_pages() was put in "i" for no evident reason.

Will be fixed.

>  5) I have no clue what the replenish flag you added to buffered_rmqueue does.
> 

A bit futuristic.  Will need it when pcp allocations gets checked first
(as Nick also mentioned).  Will remove it for now.

> You patch has:
> > can_try_harder can have following 
> >  * values:
> >  * -1 => No need to check for the watermarks.
> >  *  0 => Don't go too low down in deeps below the low watermark (GFP_HIGH)
> >  *  1 => Go far below the low watermark.  See zone_watermark_ok (RT TASK)
> 
> Later on, you have an inequality test on this value:
> 	if ((can_try_harder >= 0)
> and a non-zero test:
> 	if (can_try_harder)

The last line is from zone_watermark_ok.  The first check is in
get_page_from_freelist.  There is no (can_try_harder) check for this
flag in that function.

> 
> That's three magic values, not even in increasing order of "how hard
> one should try", tested a couple of different ways that requires
> absorbing the complete details of the three values and their ordering
> before one can read the code.
> 



--
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:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2005-10-31 21:14 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-29  1:33 [PATCH]: Clean up of __alloc_pages Rohit, Seth
2005-10-29  1:33 ` Rohit, Seth
2005-10-29  2:33 ` Nick Piggin
2005-10-29  2:33   ` Nick Piggin
2005-10-31 20:55   ` Rohit Seth
2005-10-31 20:55     ` Rohit Seth
2005-11-01  1:14     ` Nick Piggin
2005-11-01  1:14       ` Nick Piggin
2005-11-04 18:15       ` Rohit Seth
2005-11-04 18:15         ` Rohit Seth
2005-11-05  0:00         ` Nick Piggin
2005-11-05  0:00           ` Nick Piggin
2005-10-30  0:16 ` Paul Jackson
2005-10-30  0:16   ` Paul Jackson
2005-10-31 19:09   ` Rohit Seth
2005-10-31 19:09     ` Rohit Seth
2005-11-05 17:09   ` Andi Kleen
2005-11-05 17:09     ` Andi Kleen
2005-11-06  4:18     ` Paul Jackson
2005-11-06  4:18       ` Paul Jackson
2005-11-06 17:35       ` Andi Kleen
2005-11-06 17:35         ` Andi Kleen
2005-11-06 20:49         ` Paul Jackson
2005-11-06 20:49           ` Paul Jackson
2005-11-07  2:57           ` Nick Piggin
2005-11-07  2:57             ` Nick Piggin
2005-11-07  3:42             ` Andi Kleen
2005-11-07  3:42               ` Andi Kleen
2005-11-07  4:37               ` Paul Jackson
2005-11-07  4:37                 ` Paul Jackson
2005-11-07  6:08                 ` Nick Piggin
2005-11-07  6:08                   ` Nick Piggin
2005-11-07  9:46                   ` Paul Jackson
2005-11-07  9:46                     ` Paul Jackson
2005-11-07 10:17                     ` Nick Piggin
2005-11-07 10:17                       ` Nick Piggin
2005-11-07 14:41                       ` Paul Jackson
2005-11-07 14:41                         ` Paul Jackson
2005-11-07  3:44             ` Paul Jackson
2005-11-07  3:44               ` Paul Jackson
2005-10-30  1:47 ` Paul Jackson
2005-10-30  1:47   ` Paul Jackson
2005-10-30  2:01   ` Nick Piggin
2005-10-30  2:01     ` Nick Piggin
2005-10-30  2:19     ` Paul Jackson
2005-10-30  2:19       ` Paul Jackson
2005-10-30  2:32       ` Nick Piggin
2005-10-30  2:32         ` Nick Piggin
2005-10-30  3:06         ` Paul Jackson
2005-10-30  3:06           ` Paul Jackson
2005-10-30  3:53           ` Nick Piggin
2005-10-30  3:53             ` Nick Piggin
2005-10-30  2:26     ` Paul Jackson
2005-10-30  2:26       ` Paul Jackson
2005-10-30  2:36       ` Nick Piggin
2005-10-30  2:36         ` Nick Piggin
2005-10-30  3:09         ` Paul Jackson
2005-10-30  3:09           ` Paul Jackson
2005-10-30  3:55           ` Nick Piggin
2005-10-30  3:55             ` Nick Piggin
2005-10-30  4:11             ` Paul Jackson
2005-10-30  4:11               ` Paul Jackson
2005-10-31 21:20   ` Rohit Seth [this message]
2005-10-31 21:20     ` Rohit Seth
2005-10-31 21:28     ` Paul Jackson
2005-10-31 21:28       ` Paul Jackson
  -- strict thread matches above, loose matches on Subject: below --
2005-11-05  1:57 Seth, Rohit
2005-11-05  1:57 ` Seth, Rohit
2005-10-01 19:00 Seth, Rohit
2005-10-01 19:00 ` Seth, Rohit
2005-10-02  3:09 ` Nick Piggin
2005-10-02  3:09   ` Nick Piggin
2005-10-03 16:50   ` Rohit Seth
2005-10-03 16:50     ` Rohit Seth
2005-10-03 15:34 ` Christoph Lameter
2005-10-03 15:34   ` Christoph Lameter
2005-10-03 16:55   ` Rohit Seth
2005-10-03 16:55     ` Rohit Seth
2005-10-03 16:57     ` Christoph Lameter
2005-10-03 16:57       ` Christoph Lameter
2005-10-03 17:48       ` Rohit Seth
2005-10-03 17:48         ` Rohit Seth
2005-10-04 13:27         ` Andi Kleen
2005-10-04 13:27           ` Andi Kleen
2005-10-04 16:26           ` Ray Bryant
2005-10-04 16:26             ` Ray Bryant
2005-10-04 16:10             ` Martin J. Bligh
2005-10-04 16:10               ` Martin J. Bligh
2005-10-04 17:02               ` Ray Bryant
2005-10-04 17:02                 ` Ray Bryant

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=1130793655.4853.41.camel@akash.sc.intel.com \
    --to=rohit.seth@intel.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pj@sgi.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.