All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <dave@sr71.net>
To: Cody P Schafer <cody@linux.vnet.ibm.com>
Cc: Seth Jennings <sjenning@linux.vnet.ibm.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Nathan Fontenot <nfont@linux.vnet.ibm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Lai Jiangshan <laijs@cn.fujitsu.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [RFC][PATCH] drivers: base: dynamic memory block creation
Date: Wed, 14 Aug 2013 14:49:59 -0700	[thread overview]
Message-ID: <520BFB87.6050207@sr71.net> (raw)
In-Reply-To: <520BF88C.6060202@linux.vnet.ibm.com>

On 08/14/2013 02:37 PM, Cody P Schafer wrote:
> Also, I'd expect userspace tools might use readdir() to find out what
> memory blocks a system has (unless they just stat("memory0"),
> stat("memory1")...). I don't think filesystem tricks (at least within
> sysfs) are going to let this magically be solved without breaking the
> userspace API.

sysfs files are probably a bit too tied to kobjects to make this work
easily in practice.  It would probably need to be a new filesystem, imnho.

But, there's nothing to keep you from creating dentries for all of the
memory blocks if someone _does_ a readdir().  It'll suck, of course, but
it's at least compatible with what's there.  You could also 'chmod -x'
it to make it more obvious that folks shouldn't be poking around in
there, although it won't keep them from ls'ing.  If you're concerned
about resource consumption, we could also just make the directory
unreadable to everyone but root.

WARNING: multiple messages have this Message-ID (diff)
From: Dave Hansen <dave@sr71.net>
To: Cody P Schafer <cody@linux.vnet.ibm.com>
Cc: Seth Jennings <sjenning@linux.vnet.ibm.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Nathan Fontenot <nfont@linux.vnet.ibm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Lai Jiangshan <laijs@cn.fujitsu.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [RFC][PATCH] drivers: base: dynamic memory block creation
Date: Wed, 14 Aug 2013 14:49:59 -0700	[thread overview]
Message-ID: <520BFB87.6050207@sr71.net> (raw)
In-Reply-To: <520BF88C.6060202@linux.vnet.ibm.com>

On 08/14/2013 02:37 PM, Cody P Schafer wrote:
> Also, I'd expect userspace tools might use readdir() to find out what
> memory blocks a system has (unless they just stat("memory0"),
> stat("memory1")...). I don't think filesystem tricks (at least within
> sysfs) are going to let this magically be solved without breaking the
> userspace API.

sysfs files are probably a bit too tied to kobjects to make this work
easily in practice.  It would probably need to be a new filesystem, imnho.

But, there's nothing to keep you from creating dentries for all of the
memory blocks if someone _does_ a readdir().  It'll suck, of course, but
it's at least compatible with what's there.  You could also 'chmod -x'
it to make it more obvious that folks shouldn't be poking around in
there, although it won't keep them from ls'ing.  If you're concerned
about resource consumption, we could also just make the directory
unreadable to everyone but root.

--
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:[~2013-08-14 21:50 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-14 19:31 [RFC][PATCH] drivers: base: dynamic memory block creation Seth Jennings
2013-08-14 19:31 ` Seth Jennings
2013-08-14 19:40 ` Greg Kroah-Hartman
2013-08-14 19:40   ` Greg Kroah-Hartman
2013-08-16 19:07   ` Seth Jennings
2013-08-16 19:07     ` Seth Jennings
2013-08-14 19:43 ` Greg Kroah-Hartman
2013-08-14 19:43   ` Greg Kroah-Hartman
2013-08-14 20:05   ` Dave Hansen
2013-08-14 20:05     ` Dave Hansen
2013-08-14 20:35     ` Greg Kroah-Hartman
2013-08-14 20:35       ` Greg Kroah-Hartman
2013-08-14 21:16       ` Seth Jennings
2013-08-14 21:16         ` Seth Jennings
2013-08-14 21:37       ` Yinghai Lu
2013-08-14 21:52         ` Seth Jennings
2013-08-14 21:52           ` Seth Jennings
2013-08-14 23:20           ` Yinghai Lu
2013-08-14 23:20             ` Yinghai Lu
2013-08-15  2:12           ` Michael Ellerman
2013-08-15  2:12             ` Michael Ellerman
2013-08-15  2:12             ` Michael Ellerman
2013-08-14 20:40 ` Nathan Fontenot
2013-08-14 20:40   ` Nathan Fontenot
2013-08-14 20:47 ` Dave Hansen
2013-08-14 20:47   ` Dave Hansen
2013-08-14 21:14   ` Seth Jennings
2013-08-14 21:14     ` Seth Jennings
2013-08-14 21:36     ` Dave Hansen
2013-08-14 21:36       ` Dave Hansen
2013-08-14 21:37     ` Cody P Schafer
2013-08-14 21:37       ` Cody P Schafer
2013-08-14 21:49       ` Dave Hansen [this message]
2013-08-14 21:49         ` Dave Hansen
2013-08-15  0:01 ` Rafael J. Wysocki
2013-08-15  0:01   ` Rafael J. Wysocki
2013-08-16 18:41   ` Seth Jennings
2013-08-16 18:41     ` Seth Jennings

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=520BFB87.6050207@sr71.net \
    --to=dave@sr71.net \
    --cc=akpm@linux-foundation.org \
    --cc=cody@linux.vnet.ibm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nfont@linux.vnet.ibm.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=sjenning@linux.vnet.ibm.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 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.