From: Andrew Morton <akpm@linux-foundation.org>
To: Balbir Singh <balbir@linux.vnet.ibm.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux Containers <containers@lists.osdl.org>,
Paul Menage <menage@google.com>,
Linux MM Mailing List <linux-mm@kvack.org>,
David Rientjes <rientjes@google.com>,
Dave Hansen <haveblue@us.ibm.com>
Subject: Re: [-mm PATCH] Memory controller improve user interface (v2)
Date: Fri, 31 Aug 2007 13:02:16 -0700 [thread overview]
Message-ID: <20070831130216.226db806.akpm@linux-foundation.org> (raw)
In-Reply-To: <20070830185246.3170.74806.sendpatchset@balbir-laptop>
On Fri, 31 Aug 2007 00:22:46 +0530
Balbir Singh <balbir@linux.vnet.ibm.com> wrote:
> +/*
> + * Strategy routines for formating read/write data
> + */
> +int mem_container_read_strategy(unsigned long long val, char *buf)
> +{
> + return sprintf(buf, "%llu Bytes\n", val);
> +}
It's a bit cheesy to be printing the units like this. It's better to just
print the raw number.
If you really want to remind the user what units that number is in (not a
bad idea) then it can be encoded in the filename, like
/proc/sys/vm/min_free_kbytes, /proc/sys/vm/dirty_expire_centisecs, etc.
> +int mem_container_write_strategy(char *buf, unsigned long long *tmp)
> +{
> + *tmp = memparse(buf, &buf);
> + if (*buf != '\0')
> + return -EINVAL;
> +
> + printk("tmp is %llu\n", *tmp);
don't think we want that.
> + /*
> + * Round up the value to the closest page size
> + */
> + *tmp = ((*tmp + PAGE_SIZE - 1) >> PAGE_SHIFT) << PAGE_SHIFT;
> + return 0;
> +}
--
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:[~2007-08-31 20:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-30 18:52 Balbir Singh
2007-08-30 19:00 ` Balbir Singh
2007-08-31 20:02 ` Andrew Morton [this message]
2007-08-31 21:54 ` 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=20070831130216.226db806.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=containers@lists.osdl.org \
--cc=haveblue@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=menage@google.com \
--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