From: Dave Hansen <haveblue@us.ibm.com>
To: "Seth, Rohit" <rohit.seth@intel.com>
Cc: Andrew Morton <akpm@osdl.org>, linux-mm <linux-mm@kvack.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] earlier allocation of order 0 pages from pcp in __alloc_pages
Date: Thu, 29 Sep 2005 15:50:02 -0700 [thread overview]
Message-ID: <1128034202.6145.2.camel@localhost> (raw)
In-Reply-To: <20050929150155.A15646@unix-os.sc.intel.com>
On Thu, 2005-09-29 at 15:01 -0700, Seth, Rohit wrote:
> +/* This routine allocates a order 0 page from cpu's pcp list when one is present.
> + * It does not try to remove the pages from zone_free_list as the zone low
> + * water mark has not yet been checked.
> + */
> +
> +static struct page *
> +remove_from_pcp(struct zone *zone, unsigned int __nocast gfp_flags)
> +{
> + unsigned long flags;
> + struct per_cpu_pages *pcp;
> + struct page *page = NULL;
> + int cold = !!(gfp_flags & __GFP_COLD);
> +
> + pcp = &zone_pcp(zone, get_cpu())->pcp[cold];
> + local_irq_save(flags);
> + if (pcp->count > pcp->low) {
> + page = list_entry(pcp->list.next, struct page, lru);
> + list_del(&page->lru);
> + pcp->count--;
> + }
> + local_irq_restore(flags);
> + put_cpu();
> +
> + if (page != NULL) {
> + mod_page_state_zone(zone, pgalloc, 1 );
> + prep_new_page(page, 0);
> +
> + if (gfp_flags & __GFP_ZERO)
> + prep_zero_page(page, 0, gfp_flags);
> + }
> + return page;
> +}
> +
That looks to share a decent amount of logic with the pcp code in
buffered_rmqueue. Any chance it could be consolidated instead of
copy/pasting?
-- Dave
WARNING: multiple messages have this Message-ID (diff)
From: Dave Hansen <haveblue@us.ibm.com>
To: "Seth, Rohit" <rohit.seth@intel.com>
Cc: Andrew Morton <akpm@osdl.org>, linux-mm <linux-mm@kvack.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] earlier allocation of order 0 pages from pcp in __alloc_pages
Date: Thu, 29 Sep 2005 15:50:02 -0700 [thread overview]
Message-ID: <1128034202.6145.2.camel@localhost> (raw)
In-Reply-To: <20050929150155.A15646@unix-os.sc.intel.com>
On Thu, 2005-09-29 at 15:01 -0700, Seth, Rohit wrote:
> +/* This routine allocates a order 0 page from cpu's pcp list when one is present.
> + * It does not try to remove the pages from zone_free_list as the zone low
> + * water mark has not yet been checked.
> + */
> +
> +static struct page *
> +remove_from_pcp(struct zone *zone, unsigned int __nocast gfp_flags)
> +{
> + unsigned long flags;
> + struct per_cpu_pages *pcp;
> + struct page *page = NULL;
> + int cold = !!(gfp_flags & __GFP_COLD);
> +
> + pcp = &zone_pcp(zone, get_cpu())->pcp[cold];
> + local_irq_save(flags);
> + if (pcp->count > pcp->low) {
> + page = list_entry(pcp->list.next, struct page, lru);
> + list_del(&page->lru);
> + pcp->count--;
> + }
> + local_irq_restore(flags);
> + put_cpu();
> +
> + if (page != NULL) {
> + mod_page_state_zone(zone, pgalloc, 1 );
> + prep_new_page(page, 0);
> +
> + if (gfp_flags & __GFP_ZERO)
> + prep_zero_page(page, 0, gfp_flags);
> + }
> + return page;
> +}
> +
That looks to share a decent amount of logic with the pcp code in
buffered_rmqueue. Any chance it could be consolidated instead of
copy/pasting?
-- Dave
--
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>
next prev parent reply other threads:[~2005-09-29 22:50 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-29 22:01 [PATCH] earlier allocation of order 0 pages from pcp in __alloc_pages Seth, Rohit
2005-09-29 22:01 ` Seth, Rohit
2005-09-29 22:36 ` Andrew Morton
2005-09-29 22:36 ` Andrew Morton
2005-09-30 1:05 ` Rohit Seth
2005-09-30 1:05 ` Rohit Seth
2005-09-29 22:48 ` Martin J. Bligh
2005-09-29 22:48 ` Martin J. Bligh
2005-09-29 23:11 ` Andrew Morton
2005-09-29 23:11 ` Andrew Morton
2005-09-30 1:58 ` Rohit Seth
2005-09-30 1:58 ` Rohit Seth
2005-09-30 12:30 ` Martin Hicks
2005-09-30 12:30 ` Martin Hicks
2005-09-30 1:32 ` Rohit Seth
2005-09-30 1:32 ` Rohit Seth
2005-09-30 1:32 ` Martin J. Bligh
2005-09-30 1:32 ` Martin J. Bligh
2005-09-29 22:50 ` Dave Hansen [this message]
2005-09-29 22:50 ` Dave Hansen
2005-09-30 1:10 ` Rohit Seth
2005-09-30 1:10 ` Rohit Seth
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=1128034202.6145.2.camel@localhost \
--to=haveblue@us.ibm.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rohit.seth@intel.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.