FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Crash Utility

 
 
LinkBack Thread Tools
 
Old 01-05-2012, 06:37 PM
Dave Anderson
 
Default display MCNT and PRIVATE when using kmem -p

----- Original Message -----
> Hello Dave,
>
> I was using ‘kmem –p’ to get status of memory. And I could only get
> "PAGE PHYSICAL MAPPING INDEX CNT FLAGS" in 2.6.x kernel and later, which
> makes me feel the lack of information. So I think of displaying
> ‘page._mapcount’ and ‘page.private’, when using ‘kmem -p’.
>
> When adding these two items, I found ‘page._count’ is declared to be
> atomic_t whose definition is:
>
> typedef struct {
>
> volatile int counter;
>
> } atomic_t;
>
> However, current crash codes use UINT to get the value of ‘page._count’.

But it doesn't make any difference, right? The value is fprintf'd
with %d, so it is converted to a signed value.

>
> The first patch (0001-kmem_p_6.0.2.patch) is used to change UINT to INT,
> and the second one (0002-kmem_p_6.0.2.patch) will add the items talked
> above. Both patches are based on crash 6.0.2.
>
> BTW, I have tested these two patches on RHEL6.2_x86_64, RHEL6.2_i386,
> RHEL5.8_x86_64 and RHEL5.8_i386.

I appreciate the effort, but I'm not sure whether it's worth changing
it at this point, or whether it could be accomplished in a different
manner.

The primary purpose for "kmem -p" is to show the page structure
address associated with each physical address in the system -- along
with "basic information about each page". It's had those basic
fields in it forever -- which BTW, fit into 80 columns. I prefer not
to have command output exceed 80 columns unless it is impossible to
predict the size of an output field.

Anyway, the page structure definition keeps changing over time, more
specifically the embedded anonymous structures contained within it, and
the fields within the anonymous structs have multiple meanings. With
your patch, the output becomes cluttered and hard to understand, especially
due to the strange values that can be seen in the MCNT column when it's
not a counter value, but rather a slab-page construct:

union {
atomic_t _mapcount;

struct {
unsigned inuse:16;
unsigned objects:15;
unsigned frozen:1;
};
};

And so it's hard to pick which fields are more important than others,
because it pretty much depends upon what's being debugged. You have
picked the private field (which can have numerous meanings), but for
example, there have been times in the past where I wanted to see the
lru list_head contents.

That all being said, your patch does have merit, but I wonder if there
could be an alternate way of selecting or filtering what fields are
displayed?

Dave

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 01-09-2012, 05:51 AM
qiaonuohan
 
Default display MCNT and PRIVATE when using kmem -p

Hello Dave,

I think it is necessary to see what is hided in the union where
_mapcount lies. However, as you said, it's hard to pick which fields are
more important than others when adding new items to "kmem -p". So I
think over using struct sub-command to show what I want.


What if I change struct sub-command to this:

1. it can refer to anonymous members (e.g., page._mapcount)
2. it can refer to submembers(e.g., page._count.counter)
3. it can output easy-parsing format (using an option to specify), maybe
like 'kmem -p'. For example,

crash> struct page.flags,_count.counter -.. < PAGE_list.txt
1024 0
1024 1
1024 1
1024 1

After adding these features to struct sub-command, I guess it is more
easier to get information hiding in structs and parsing it. Before
implementing, I feel the necessity to ask you for some advices. So what
about these features?


At 2012-1-6 3:37, Dave Anderson wrote:

I appreciate the effort, but I'm not sure whether it's worth changing
it at this point, or whether it could be accomplished in a different
manner.

The primary purpose for "kmem -p" is to show the page structure
address associated with each physical address in the system -- along
with "basic information about each page". It's had those basic
fields in it forever -- which BTW, fit into 80 columns. I prefer not
to have command output exceed 80 columns unless it is impossible to
predict the size of an output field.

Anyway, the page structure definition keeps changing over time, more
specifically the embedded anonymous structures contained within it, and
the fields within the anonymous structs have multiple meanings. With
your patch, the output becomes cluttered and hard to understand, especially
due to the strange values that can be seen in the MCNT column when it's
not a counter value, but rather a slab-page construct:

union {
atomic_t _mapcount;

struct {
unsigned inuse:16;
unsigned objects:15;
unsigned frozen:1;
};
};

And so it's hard to pick which fields are more important than others,
because it pretty much depends upon what's being debugged. You have
picked the private field (which can have numerous meanings), but for
example, there have been times in the past where I wanted to see the
lru list_head contents.

That all being said, your patch does have merit, but I wonder if there
could be an alternate way of selecting or filtering what fields are
displayed?



--
--
Regards
Qiao Nuohan

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 02-28-2012, 02:37 PM
Dave Anderson
 
Default display MCNT and PRIVATE when using kmem -p

----- Original Message -----
> At 2012-1-10 21:54, Dave Anderson wrote:
> >
> >
> > ----- Original Message -----
> >> Hello Dave,
> >>
> >> Glad to hear the capability is desirable. I will start to implement this
> >> soon.
> >>
> >
> >>>> What if I change struct sub-command to this:
> >>>>
> >>>> 1. it can refer to anonymous members (e.g., page._mapcount)
> >>>> 2. it can refer to submembers(e.g., page._count.counter)
> >
> > One other suggestion -- I believe it should not be necessary to
> > support the "page._count.counter" format, because you can get
> > the data by using the container name. Taking the "_count.counter"
> > example:
> >
> > crash> p ((struct page *)0xffffea0000000200)._count.counter
> > $10 = 0
> > crash> p ((struct page *)0xffffea0000000200)._count
> > $11 = {
> > counter = 0
> > }
> > crash>
> >
> > So using "page._count" should suffice.
> >
> > Thanks,
> > Dave
> >
> > --
> > Crash-utility mailing list
> > Crash-utility@redhat.com
> > https://www.redhat.com/mailman/listinfo/crash-utility
> >
> >
> Hello Dave,
>
> Sorry for reacting late. I have started to realize these item we talked
> before. But, considering your mail about "page._count.counter" format, I
> need to explain my opinion to you. Trying to support the
> "page._count.counter" format is used to help implementing the formatted
> output like:
>
> crash> struct page.flags,_count.counter -.. < PAGE_list.txt
> 1024 0
> 1024 1
> 1024 1
> 1024 1
>
> Compared with "p ((struct page *)0xffffea0000000200)._count.counter",
> which can only display only one data each time, the former style can be
> more helpful when parsing the output.
>
> The reason why I want the "page._count.counter" format is I want to
> offer an efficient way to collect a lot of data. Then I'd like you to
> give some comments. Thanks.

I'm not interested in completely changing the output format of the "struct"
command to display the raw data for multiple fields on a single line as
you've shown in your example above. It's completely redefining the output
format of the command. If you want to implement something like that, it
would have to be governed by a new output option, expressed something like:

crash> struct -<raw-output-option> page.flags,_count.counter

And if you were to do something like that, then I still maintain that the
"page._count.counter" format is unnecessary. You're going to be dumping
the whole structure behind the scenes, and then parsing for whatever fields
you're looking for.

Dave

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 02-29-2012, 09:09 AM
qiaonuohan
 
Default display MCNT and PRIVATE when using kmem -p

At 2012-2-28 23:37, Dave Anderson wrote:



----- Original Message -----

At 2012-1-10 21:54, Dave Anderson wrote:



----- Original Message -----

Hello Dave,

Glad to hear the capability is desirable. I will start to implement this
soon.




What if I change struct sub-command to this:

1. it can refer to anonymous members (e.g., page._mapcount)
2. it can refer to submembers(e.g., page._count.counter)


One other suggestion -- I believe it should not be necessary to
support the "page._count.counter" format, because you can get
the data by using the container name. Taking the "_count.counter"
example:

crash> p ((struct page *)0xffffea0000000200)._count.counter
$10 = 0
crash> p ((struct page *)0xffffea0000000200)._count
$11 = {
counter = 0
}
crash>

So using "page._count" should suffice.

Thanks,
Dave

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility



Hello Dave,

Sorry for reacting late. I have started to realize these item we talked
before. But, considering your mail about "page._count.counter" format, I
need to explain my opinion to you. Trying to support the
"page._count.counter" format is used to help implementing the formatted
output like:

crash> struct page.flags,_count.counter -..< PAGE_list.txt
1024 0
1024 1
1024 1
1024 1

Compared with "p ((struct page *)0xffffea0000000200)._count.counter",
which can only display only one data each time, the former style can be
more helpful when parsing the output.

The reason why I want the "page._count.counter" format is I want to
offer an efficient way to collect a lot of data. Then I'd like you to
give some comments. Thanks.


I'm not interested in completely changing the output format of the "struct"
command to display the raw data for multiple fields on a single line as
you've shown in your example above. It's completely redefining the output
format of the command. If you want to implement something like that, it
would have to be governed by a new output option, expressed something like:

crash> struct -<raw-output-option> page.flags,_count.counter

And if you were to do something like that, then I still maintain that the
"page._count.counter" format is unnecessary. You're going to be dumping
the whole structure behind the scenes, and then parsing for whatever fields
you're looking for.


Do you mean you don't accept changing the output format or simplely the
"page._count.counter" format?


As we talk before, I want to get "_count.counter" of several pages. So
the "page._count.counter" format comes up, which is not acceptable. If
you can accept changing the output format by using a new output option,
just like:


flags = 0
_count = {
counter = 0
}
...

change to:

"0 {0} ..." or "0 { counter = 0 } ..." or 0 "{ .counter = 0 } ..."

Actually the original code is easy to read, but hard to parse. So please
think about the above change.




Dave

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility





--
--
Regards
Qiao Nuohan

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 

Thread Tools




All times are GMT. The time now is 03:21 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org