All of lore.kernel.org
 help / color / mirror / Atom feed
From: yamamoto@valinux.co.jp (YAMAMOTO Takashi)
To: balbir@linux.vnet.ibm.com
Cc: linux-mm@kvack.org, hugh@veritas.com, a.p.zijlstra@chello.nl,
	menage@google.com, Lee.Schermerhorn@hp.com, herbert@13thfloor.at,
	ebiederm@xmission.com, rientjes@google.com, xemul@openvz.org,
	nickpiggin@yahoo.com.au, riel@redhat.com,
	akpm@linux-foundation.org, kamezawa.hiroyu@jp.fujitsu.com
Subject: Re: [RFC] [PATCH 3/4] Reclaim from groups over their soft limit under memory pressure
Date: Thu, 14 Feb 2008 19:27:58 +0900 (JST)	[thread overview]
Message-ID: <20080214102758.D2CD91E3C58@siro.lan> (raw)
In-Reply-To: Your message of "Wed, 13 Feb 2008 20:42:42 +0530" <20080213151242.7529.79924.sendpatchset@localhost.localdomain>

> +/*
> + * Free all control groups, which are over their soft limit
> + */
> +unsigned long mem_cgroup_pushback_groups_over_soft_limit(struct zone **zones,
> +								gfp_t gfp_mask)
> +{
> +	struct mem_cgroup *mem;
> +	unsigned long nr_pages;
> +	long long nr_bytes_over_sl;
> +	unsigned long ret = 0;
> +	unsigned long flags;
> +	struct list_head reclaimed_groups;
>  
> +	INIT_LIST_HEAD(&reclaimed_groups);
> +	read_lock_irqsave(&mem_cgroup_sl_list_lock, flags);
> +	while (!list_empty(&mem_cgroup_sl_exceeded_list)) {
> +		mem = list_first_entry(&mem_cgroup_sl_exceeded_list,
> +				struct mem_cgroup, sl_exceeded_list);
> +		list_move(&mem->sl_exceeded_list, &reclaimed_groups);
> +		read_unlock_irqrestore(&mem_cgroup_sl_list_lock, flags);
> +
> +		nr_bytes_over_sl = res_counter_sl_excess(&mem->res);
> +		if (nr_bytes_over_sl <= 0)
> +			goto next;
> +		nr_pages = (nr_bytes_over_sl >> PAGE_SHIFT);
> +		ret += try_to_free_mem_cgroup_pages(mem, gfp_mask, nr_pages,
> +							zones);
> +next:
> +		read_lock_irqsave(&mem_cgroup_sl_list_lock, flags);
> +	}

what prevents the cgroup 'mem' from disappearing while we are dropping
mem_cgroup_sl_list_lock?

YAMAMOTO Takashi

--
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:[~2008-02-14 10:27 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-13 15:12 [RFC] [PATCH 0/4] Add soft limits to the memory controller Balbir Singh
2008-02-13 15:12 ` [RFC] [PATCH 1/4] Modify resource counters to add soft limit support Balbir Singh
2008-02-13 17:12   ` Pavel Emelyanov
2008-02-13 17:19     ` Balbir Singh
2008-02-13 17:38       ` Pavel Emelyanov
2008-02-13 17:54         ` Balbir Singh
2008-02-13 15:12 ` [RFC] [PATCH 2/4] Add the soft limit interface Balbir Singh
2008-02-13 15:12 ` [RFC] [PATCH 3/4] Reclaim from groups over their soft limit under memory pressure Balbir Singh
2008-02-14  7:30   ` KAMEZAWA Hiroyuki
2008-02-14  7:40     ` Balbir Singh
2008-02-14  8:42       ` KAMEZAWA Hiroyuki
2008-02-14  9:16         ` Balbir Singh
2008-02-15  4:17           ` Paul Menage
2008-02-15  4:25             ` Balbir Singh
2008-02-15  5:07               ` KAMEZAWA Hiroyuki
2008-02-15  5:16                 ` Paul Menage
2008-02-15  5:18                   ` Balbir Singh
2008-02-15  5:30                     ` Paul Menage
2008-02-15  5:33                     ` KAMEZAWA Hiroyuki
2008-02-15  5:29                   ` KAMEZAWA Hiroyuki
2008-02-15  6:36                     ` Balbir Singh
2008-02-14 10:27   ` YAMAMOTO Takashi [this message]
2008-02-15  3:19     ` Balbir Singh
2008-02-13 15:12 ` [RFC] [PATCH 4/4] Add soft limit documentation Balbir Singh
2008-02-13 15:59   ` Randy Dunlap
2008-02-13 16:08     ` Balbir Singh

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=20080214102758.D2CD91E3C58@siro.lan \
    --to=yamamoto@valinux.co.jp \
    --cc=Lee.Schermerhorn@hp.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=ebiederm@xmission.com \
    --cc=herbert@13thfloor.at \
    --cc=hugh@veritas.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    --cc=menage@google.com \
    --cc=nickpiggin@yahoo.com.au \
    --cc=riel@redhat.com \
    --cc=rientjes@google.com \
    --cc=xemul@openvz.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 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.