From: Andrew Morton <akpm@linux-foundation.org>
To: Balbir Singh <balbir@linux.vnet.ibm.com>
Cc: linux-mm@kvack.org, yamamoto@valinux.co.jp, lizf@cn.fujitsu.com,
kosaki.motohiro@jp.fujitsu.com, riel@redhat.com,
kamezawa.hiroyu@jp.fujitsu.com
Subject: Re: [PATCH 2/4] Memory controller soft limit interface (v5)
Date: Thu, 12 Mar 2009 15:59:05 -0700 [thread overview]
Message-ID: <20090312155905.81a3415a.akpm@linux-foundation.org> (raw)
In-Reply-To: <20090312175620.17890.69177.sendpatchset@localhost.localdomain>
On Thu, 12 Mar 2009 23:26:20 +0530
Balbir Singh <balbir@linux.vnet.ibm.com> wrote:
> +/**
> + * Get the difference between the usage and the soft limit
> + * @cnt: The counter
> + *
> + * Returns 0 if usage is less than or equal to soft limit
> + * The difference between usage and soft limit, otherwise.
> + */
> +static inline unsigned long long
> +res_counter_soft_limit_excess(struct res_counter *cnt)
> +{
> + unsigned long long excess;
> + unsigned long flags;
> +
> + spin_lock_irqsave(&cnt->lock, flags);
> + if (cnt->usage <= cnt->soft_limit)
> + excess = 0;
> + else
> + excess = cnt->usage - cnt->soft_limit;
> + spin_unlock_irqrestore(&cnt->lock, flags);
> + return excess;
> +}
>
> ...
>
> +static inline bool res_counter_check_under_soft_limit(struct res_counter *cnt)
> +{
> + bool ret;
> + unsigned long flags;
> +
> + spin_lock_irqsave(&cnt->lock, flags);
> + ret = res_counter_soft_limit_check_locked(cnt);
> + spin_unlock_irqrestore(&cnt->lock, flags);
> + return ret;
> +}
>
> ...
>
> +static inline int
> +res_counter_set_soft_limit(struct res_counter *cnt,
> + unsigned long long soft_limit)
> +{
> + unsigned long flags;
> +
> + spin_lock_irqsave(&cnt->lock, flags);
> + cnt->soft_limit = soft_limit;
> + spin_unlock_irqrestore(&cnt->lock, flags);
> + return 0;
> +}
These functions look too large to be inlined?
--
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:[~2009-03-12 23:03 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-12 17:56 [PATCH 0/4] Memory controller soft limit patches (v5) Balbir Singh
2009-03-12 17:56 ` [PATCH 1/4] Memory controller soft limit documentation (v5) Balbir Singh
2009-03-12 17:56 ` [PATCH 2/4] Memory controller soft limit interface (v5) Balbir Singh
2009-03-12 22:59 ` Andrew Morton [this message]
2009-03-13 4:58 ` Balbir Singh
2009-03-12 17:56 ` [PATCH 3/4] Memory controller soft limit organize cgroups (v5) Balbir Singh
2009-03-12 23:04 ` Andrew Morton
2009-03-13 5:03 ` Balbir Singh
2009-03-13 0:47 ` KOSAKI Motohiro
2009-03-13 5:04 ` Balbir Singh
2009-03-13 5:22 ` KOSAKI Motohiro
2009-03-13 8:20 ` Balbir Singh
2009-03-13 6:59 ` KAMEZAWA Hiroyuki
2009-03-13 7:09 ` Balbir Singh
2009-03-12 17:56 ` [PATCH 4/4] Memory controller soft limit reclaim on contention (v5) Balbir Singh
2009-03-12 23:34 ` Andrew Morton
2009-03-13 7:53 ` Balbir Singh
2009-03-13 1:36 ` KOSAKI Motohiro
2009-03-13 4:13 ` Balbir Singh
2009-03-13 4:31 ` KOSAKI Motohiro
2009-03-13 4:50 ` KOSAKI Motohiro
2009-03-13 5:07 ` Balbir Singh
2009-03-13 6:54 ` KOSAKI Motohiro
2009-03-13 7:03 ` Balbir Singh
2009-03-13 7:17 ` KOSAKI Motohiro
2009-03-13 7:26 ` Balbir Singh
2009-03-13 8:37 ` KAMEZAWA Hiroyuki
2009-03-13 5:26 ` Balbir Singh
2009-03-13 5:34 ` KOSAKI Motohiro
2009-03-13 4:58 ` Balbir Singh
2009-03-13 6:51 ` KAMEZAWA Hiroyuki
2009-03-13 7:15 ` Balbir Singh
2009-03-13 8:41 ` KAMEZAWA Hiroyuki
2009-03-13 7:02 ` [PATCH 0/4] Memory controller soft limit patches (v5) KAMEZAWA Hiroyuki
2009-03-13 7:07 ` KAMEZAWA Hiroyuki
2009-03-13 7:15 ` Andrew Morton
2009-03-13 7:29 ` Balbir Singh
2009-03-13 7:18 ` 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=20090312155905.81a3415a.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-mm@kvack.org \
--cc=lizf@cn.fujitsu.com \
--cc=riel@redhat.com \
--cc=yamamoto@valinux.co.jp \
/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