lkml.org 
[lkml]   [2009]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 3/3][mmotm] updateing size of kcore
From
On Thu, Sep 17, 2009 at 3:14 PM, KAMEZAWA Hiroyuki
<kamezawa.hiroyu@jp.fujitsu.com> wrote:
> On Thu, 17 Sep 2009 14:59:35 +0800
> Américo Wang <xiyou.wangcong@gmail.com> wrote:
>
>> On Thu, Sep 17, 2009 at 10:45 AM, KAMEZAWA Hiroyuki
>> <kamezawa.hiroyu@jp.fujitsu.com> wrote:
>> >
>> > After memory hotplug (or other events in future), kcore size
>> > can be modified.
>> >
>> > To update inode->i_size, we have to know inode/dentry but we
>> > can't get it from inside /proc directly.
>> > But considerinyg memory hotplug, kcore image is updated only when
>> > it's opened. Then, updating inode->i_size at open() is enough.
>> >
>> > Cc: WANG Cong <xiyou.wangcong@gmail.com>
>> > Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
>>
>>
>> This patch looks fine.
>>
>> However, I am thinking if kcore is the only file under /proc whose size
>> is changed dynamically? If no, that probably means we need to change
>> generic proc code.
>>
> I tried yesteray, and back to this ;)
>
> One thing which makes me confused is that there is no way to get
> inode or dentry from proc_dir_entry.
>
> I tried to rewrite proc_getattr() for cheating "ls". But it just works for
> "stat" and inode->i_size is used more widely. So, this implementation now.

Yeah, stat->size is from inode->i_size.

>
> But considering practically, inode->i_size itself is not meaningful in /proc
> files even if it's correct. For example, /proc/vmstat or /proc/stat,
> /proc/<pid>/maps... etc...

Yes.

>
> inode->i_size will be dynamically changed while reading. Now, most of users
> know regular files under /proc is not a "real" file and handle them in proper
> way. (programs can be used with pipe/stdin works well.)
>
> I wonder /proc/kcore is a special one, which gdb/objdump/readelf may access.
> Above 3 programs are for "usual" files and not considering pseudo files under
> /proc. So, I think adding generic i->i_size support is an overkill until
> there are users depends on that.

At least I can't think out another /proc file as special as kcore. :-/

Thanks for your analysis, no problem with this patch.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2009-09-18 04:07    [W:1.095 / U:1.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site