From: Christoph Lameter <cl@linux.com>
To: Glauber Costa <glommer@parallels.com>
Cc: Pekka Enberg <penberg@kernel.org>,
linux-mm@kvack.org, David Rientjes <rientjes@google.com>,
Matt Mackall <mpm@selenic.com>
Subject: Re: [RFC] SL[AUO]B common code 1/9] [slob] define page struct fields used in mm_types.h
Date: Wed, 16 May 2012 10:38:39 -0500 (CDT) [thread overview]
Message-ID: <alpine.DEB.2.00.1205161034400.25603@router.home> (raw)
In-Reply-To: <alpine.DEB.2.00.1205160925410.25603@router.home>
On Wed, 16 May 2012, Christoph Lameter wrote:
> On Wed, 16 May 2012, Glauber Costa wrote:
>
> > It is of course ok to reuse the field, but what about we make it a union
> > between "list" and "lru" ?
>
> That is what this patch does. You are commenting on code that was
> removed.
Argh. No it doesnt..... It will be easy to add though. But then you have
two list_head definitions in page struct that just differ in name.
Index: linux-2.6/mm/slob.c
===================================================================
--- linux-2.6.orig/mm/slob.c 2012-05-16 04:36:42.531867096 -0500
+++ linux-2.6/mm/slob.c 2012-05-16 04:36:13.611867636 -0500
@@ -142,13 +142,13 @@ static inline int slob_page_free(struct
static void set_slob_page_free(struct page *sp, struct list_head *list)
{
- list_add(&sp->lru, list);
+ list_add(&sp->list, list);
__SetPageSlobFree(sp);
}
static inline void clear_slob_page_free(struct page *sp)
{
- list_del(&sp->lru);
+ list_del(&sp->list);
__ClearPageSlobFree(sp);
}
@@ -314,7 +314,7 @@ static void *slob_alloc(size_t size, gfp
spin_lock_irqsave(&slob_lock, flags);
/* Iterate through each partially free page, try to find room */
- list_for_each_entry(sp, slob_list, lru) {
+ list_for_each_entry(sp, slob_list, list) {
#ifdef CONFIG_NUMA
/*
* If there's a node specification, search for a partial
@@ -328,7 +328,7 @@ static void *slob_alloc(size_t size, gfp
continue;
/* Attempt to alloc */
- prev = sp->lru.prev;
+ prev = sp->list.prev;
b = slob_page_alloc(sp, size, align);
if (!b)
continue;
@@ -354,7 +354,7 @@ static void *slob_alloc(size_t size, gfp
spin_lock_irqsave(&slob_lock, flags);
sp->units = SLOB_UNITS(PAGE_SIZE);
sp->freelist = b;
- INIT_LIST_HEAD(&sp->lru);
+ INIT_LIST_HEAD(&sp->list);
set_slob(b, SLOB_UNITS(PAGE_SIZE), b + SLOB_UNITS(PAGE_SIZE));
set_slob_page_free(sp, slob_list);
b = slob_page_alloc(sp, size, align);
Index: linux-2.6/include/linux/mm_types.h
===================================================================
--- linux-2.6.orig/include/linux/mm_types.h 2012-05-16 04:36:42.535867105 -0500
+++ linux-2.6/include/linux/mm_types.h 2012-05-16 04:35:37.963868439 -0500
@@ -97,6 +97,7 @@ struct page {
struct list_head lru; /* Pageout list, eg. active_list
* protected by zone->lru_lock !
*/
+ struct list_head list; /* slobs list of pages */
struct { /* slub per cpu partial pages */
struct page *next; /* Next partial slab */
#ifdef CONFIG_64BIT
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2012-05-16 15:38 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-14 20:15 [RFC] SL[AUO]B common code 0/9] Sl[auo]b: Common functionality V1 Christoph Lameter
2012-05-14 20:15 ` [RFC] SL[AUO]B common code 1/9] [slob] define page struct fields used in mm_types.h Christoph Lameter
2012-05-16 7:31 ` Glauber Costa
2012-05-16 14:26 ` Christoph Lameter
2012-05-16 15:38 ` Christoph Lameter [this message]
2012-05-17 9:41 ` Glauber Costa
2012-05-17 14:09 ` Christoph Lameter
2012-05-14 20:15 ` [RFC] SL[AUO]B common code 2/9] [slab]: Use page struct fields instead of casting Christoph Lameter
2012-05-16 7:52 ` Glauber Costa
2012-05-14 20:15 ` [RFC] SL[AUO]B common code 3/9] Extract common fields from struct kmem_cache Christoph Lameter
2012-05-16 7:59 ` Glauber Costa
2012-05-16 14:28 ` Christoph Lameter
2012-05-16 15:41 ` Christoph Lameter
[not found] ` <alpine.LFD.2.02.1205160943180.2249@tux.localdomain>
[not found] ` <alpine.DEB.2.00.1205160922520.25512@router.home>
[not found] ` <alpine.LFD.2.02.1205181221570.3899@tux.localdomain>
2012-05-18 13:57 ` Christoph Lameter
2012-05-14 20:15 ` [RFC] SL[AUO]B common code 4/9] slabs: Extract common code for kmem_cache_create Christoph Lameter
2012-05-14 20:15 ` [RFC] SL[AUO]B common code 5/9] slabs: Common definition for boot state of the slab allocators Christoph Lameter
2012-05-16 8:19 ` Glauber Costa
2012-05-16 14:31 ` Christoph Lameter
2012-05-17 9:38 ` Glauber Costa
2012-05-17 14:07 ` Christoph Lameter
2012-05-17 14:08 ` Glauber Costa
2012-05-17 14:16 ` Christoph Lameter
2012-05-17 14:19 ` Glauber Costa
2012-05-17 14:27 ` Christoph Lameter
2012-05-16 15:44 ` Christoph Lameter
2012-05-14 20:15 ` [RFC] SL[AUO]B common code 6/9] slabs: Use a common mutex definition Christoph Lameter
2012-05-16 8:34 ` Glauber Costa
2012-05-16 14:32 ` Christoph Lameter
2012-05-14 20:15 ` [RFC] SL[AUO]B common code 7/9] slabs: Move kmem_cache_create mutex handling to common code Christoph Lameter
2012-05-16 10:15 ` Glauber Costa
2012-05-14 20:15 ` [RFC] SL[AUO]B common code 8/9] slabs: list addition move to slab_common Christoph Lameter
2012-05-16 10:09 ` Glauber Costa
2012-05-16 14:33 ` Christoph Lameter
2012-05-17 9:39 ` Glauber Costa
2012-05-17 14:09 ` Christoph Lameter
2012-05-14 20:15 ` [RFC] SL[AUO]B common code 9/9] slabs: Extract a common function for kmem_cache_destroy Christoph Lameter
2012-05-16 8:08 ` [RFC] SL[AUO]B common code 0/9] Sl[auo]b: Common functionality V1 Glauber Costa
2012-05-16 14:28 ` Christoph Lameter
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=alpine.DEB.2.00.1205161034400.25603@router.home \
--to=cl@linux.com \
--cc=glommer@parallels.com \
--cc=linux-mm@kvack.org \
--cc=mpm@selenic.com \
--cc=penberg@kernel.org \
--cc=rientjes@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox