linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Pekka Enberg <penberg@kernel.org>
To: Joonsoo Kim <js1304@gmail.com>
Cc: Christoph Lameter <cl@linux-foundation.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	David Rientjes <rientjes@google.com>
Subject: Re: [PATCH 1,2/4 v4] slub: use __cmpxchg_double_slab() at interrupt disabled place
Date: Wed, 20 Jun 2012 10:14:28 +0300 (EEST)	[thread overview]
Message-ID: <alpine.LFD.2.02.1206201013500.1933@tux.localdomain> (raw)
In-Reply-To: <1337346077-2754-1-git-send-email-js1304@gmail.com>

On Fri, 18 May 2012, Joonsoo Kim wrote:

> get_freelist(), unfreeze_partials() are only called with interrupt disabled,
> so __cmpxchg_double_slab() is suitable.
> 
> Acked-by: Christoph Lameter <cl@linux.com>
> Signed-off-by: Joonsoo Kim <js1304@gmail.com>

Applied, thanks!

> ---
> According to comment from Pekka, add some comment.
> 
> diff --git a/mm/slub.c b/mm/slub.c
> index 0c3105c..d7f8291 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -1879,7 +1879,11 @@ redo:
>  	}
>  }
>  
> -/* Unfreeze all the cpu partial slabs */
> +/*
> + * Unfreeze all the cpu partial slabs.
> + *
> + * This function must be called with interrupt disabled.
> + */
>  static void unfreeze_partials(struct kmem_cache *s)
>  {
>  	struct kmem_cache_node *n = NULL;
> @@ -1935,7 +1939,7 @@ static void unfreeze_partials(struct kmem_cache *s)
>  				l = m;
>  			}
>  
> -		} while (!cmpxchg_double_slab(s, page,
> +		} while (!__cmpxchg_double_slab(s, page,
>  				old.freelist, old.counters,
>  				new.freelist, new.counters,
>  				"unfreezing slab"));
> @@ -2163,6 +2167,8 @@ static inline void *new_slab_objects(struct kmem_cache *s, gfp_t flags,
>   * The page is still frozen if the return value is not NULL.
>   *
>   * If this function returns NULL then the page has been unfrozen.
> + *
> + * This function must be called with interrupt disabled.
>   */
>  static inline void *get_freelist(struct kmem_cache *s, struct page *page)
>  {
> @@ -2179,7 +2185,7 @@ static inline void *get_freelist(struct kmem_cache *s, struct page *page)
>  		new.inuse = page->objects;
>  		new.frozen = freelist != NULL;
>  
> -	} while (!cmpxchg_double_slab(s, page,
> +	} while (!__cmpxchg_double_slab(s, page,
>  		freelist, counters,
>  		NULL, new.counters,
>  		"get_freelist"));
> -- 
> 1.7.9.5
> 
> 

--
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>

      reply	other threads:[~2012-06-20  7:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-17 15:47 [PATCH 0/4] slub: refactoring some code in slub Joonsoo Kim
2012-05-17 15:47 ` [PATCH 1/4] slub: change cmpxchg_double_slab in get_freelist() to __cmpxchg_double_slab Joonsoo Kim
2012-05-17 15:47 ` [PATCH 2/4] slub: change cmpxchg_double_slab in unfreeze_partials " Joonsoo Kim
2012-05-17 15:47 ` [PATCH 3/4] slub: use __SetPageSlab function to set PG_slab flag Joonsoo Kim
2012-05-17 16:07   ` Christoph Lameter
2012-05-18  9:31   ` Pekka Enberg
2012-05-17 15:47 ` [PATCH 4/4] slub: refactoring unfreeze_partials() Joonsoo Kim
2012-05-17 18:30   ` Christoph Lameter
2012-05-18 13:11     ` JoonSoo Kim
2012-06-01 12:28     ` Joonsoo Kim
2012-06-01 15:57   ` Christoph Lameter
2012-05-17 16:08 ` [PATCH 0/4] slub: refactoring some code in slub Christoph Lameter
2012-05-17 16:34   ` JoonSoo Kim
2012-05-17 16:41 ` [PATCH 1,2/4 v2] slub: use __cmpxchg_double_slab() at interrupt disabled place Joonsoo Kim
2012-05-17 16:49   ` Christoph Lameter
2012-05-17 17:03     ` [PATCH 1,2/4 v3] " Joonsoo Kim
2012-05-18  9:31     ` [PATCH 1,2/4 v2] " Pekka Enberg
2012-05-18 13:01       ` [PATCH 1,2/4 v4] " Joonsoo Kim
2012-06-20  7:14         ` Pekka Enberg [this message]

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.LFD.2.02.1206201013500.1933@tux.localdomain \
    --to=penberg@kernel.org \
    --cc=cl@linux-foundation.org \
    --cc=js1304@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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;
as well as URLs for NNTP newsgroup(s).