Re: apparently, i don't know seq_files as well as i thought

2009-09-04 Thread Pei Lin
http://tldp.org/LDP/lkmpg/2.6/html/x861.html
http://lwn.net/Articles/22355/

BRs

Lin

2009/9/3 Robert P. J. Day :
>
>  was in the midst of writing my final installment of newbie column
> for how to use /proc sequence files for debugging, and suddenly i'm
> not convinced i know every detail about them.  in particular, i'm
> looking at the prototype for the "stop" routine:
>
>  void stop(struct seq_file* s, void* v);
>
> and the question is:  what is it that one should expect in the "v"
> parameter when the relevant stop() routine is invoked?
>
>  specifically, i wrote an example that generates so much output that
> the start() routine is invoked a number of times to keep restarting
> the output at various points, and all that works just fine.
>
>  but it *seems* that, at each *intermediate* call to the stop
> routine, "v" will contain the current void pointer to whatever it is
> you want to point at.  but in the *final* call to the stop routine to
> really terminate the output, that pointer value is *null*.
>
>  that just seems weird, and i can't find documentation that really
> and truly describes the mechanics.  perhaps i'll post the code
> shortly, and people can test it.  that will, of course, spoil the
> surprise of the next column, but i'd rather be right than surprising.
>
> rday
> --
>
> 
> Robert P. J. Day                               Waterloo, Ontario, CANADA
>
>        Linux Consulting, Training and Annoying Kernel Pedantry.
>
> Web page:                                          http://crashcourse.ca
> Twitter:                                       http://twitter.com/rpjday
> 
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to ecar...@nl.linux.org
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



[OOT] Link to my Linux.com "Uncover the meaning of top's statistics"

2009-09-04 Thread Mulyadi Santosa
Dear member of the list

First of all, sorry for this OOT posting.

Please kindly visit my article at this URL
http://linux.com/learn/tutorials/42048-uncover-the-meaning-of-tops-statistics.
And if you have time, perhaps you can write down your feedback. To
avoid further OOT, please directly send any of your feedback to my
personal Gmail address.

Thank you in advance for your attention.

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer
blog: the-hydra.blogspot.com

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: decoding kernel oops

2009-09-04 Thread Mulyadi Santosa
Hi...

On Fri, Sep 4, 2009 at 11:05 PM, Manish Katiyar wrote:
> thanks a lot.. now if I go back and read the post again, it is much
> more clear. BTW probably a stupid question, why does the op code in
> char string generates back the assembly ??

Hmm well that's because that hex chars are the representation of the
related assembly instructions. And gdb does it nicely for you. Without
it, you need to check Intel manual page by page, line by line to see
what they really mean :)

Is that what you ask? Or do you mean something else with the above question?

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer
blog: the-hydra.blogspot.com

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: for swap only? /proc/sys/vm/pages_cluster

2009-09-04 Thread Ed Cashin
Mulyadi Santosa  writes:

> On Fri, Sep 4, 2009 at 9:51 PM, Ed Cashin wrote:
>> The way I read the Documentation/filesystems/proc.txt and
>> mm/swapfile.c in 2.6.16.62, it looks like /proc/sys/vm/pages_cluster
>> has nothing to do with non-swap paging but is only used in swapfile.c.
>>
>> So in a system without any swap in use, changing the setting would
>> have no effect.
>>
>> Is that correct?
...
> perhaps a small note first. In 2.6.30.4 source tree, the related
> documentation is in Documentation/sysctl/vm.txt.
>
> And yeap, I think the sentences are quite clear there. It only matters
> if you have swap, be it swap partition or swap file.

Thanks.  I think that text is the same as the 2.6.16.y
Documentation/filesystems/proc.txt info for page-cluster (not
pages-cluster as I mistakenly called it in the original post.)

-- 
  Ed Cashin 
  Find experimental aoe Linux driver patches at
  http://coraid.typepad.com/aoe_linux_proving_grounds/


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: decoding kernel oops

2009-09-04 Thread Manish Katiyar
On Thu, Sep 3, 2009 at 6:45 AM, Mulyadi
Santosa wrote:
> On Wed, Sep 2, 2009 at 6:08 PM, Manish Katiyar wrote:
>> Hi,
>>
>> I was going through this post
>> http://kerneltrap.org/mailarchive/linux-kernel/2008/1/8/546623 and
>> couldn't understand the steps around the below paragraph.
>>
>> "
>> and run it under gdb, and then when it gets the SIGSEGV (due to the
>> obvious NULL pointer dereference), I can just ask gdb to disassemble
>> around the array that contains the code[] stuff. Try a few offsets, to see
>> when the disassembly makes sense (and gives the reported EIP as the
>> beginning of one of the disassembled instructions).
>> "
>> Has anyone tried this ?? I don't see any useful disas instructions
>> when I do so ... Need help in interpreting the procedures of the above
>> pos
>
> Hi Manish...
>
> I am not so clear either, but perhaps by exchanging each of our
> knowledge, we can teach each other. Specificly, which part that
> confuses you? The disas part? That's what the "x/20i" does toward the
> start address of array "array". It turns that sequence of hex numbers
> into instructions.
>
> I think the real art here is spotting the offending instruction. I
> think Linus find it out actually by lookin that there is prefetch
> instruction in array+49. And since it's prefetching at the address
> stored in %eax, so the last instruction that modifies its content is
> surely the root of the problem.
>
> In the other cases, decoding might be not that easy. So IMO that's why
> stack trace provides code context. It's not just the offending
> instruction which is dumped, but ones sorrounding it.

thanks a lot.. now if I go back and read the post again, it is much
more clear. BTW probably a stupid question, why does the op code in
char string generates back the assembly ??


>
> --
> regards,
>
> Mulyadi Santosa
> Freelance Linux trainer
> blog: the-hydra.blogspot.com
>



-- 
Thanks -
Manish

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: for swap only? /proc/sys/vm/pages_cluster

2009-09-04 Thread Mulyadi Santosa
On Fri, Sep 4, 2009 at 9:51 PM, Ed Cashin wrote:
> The way I read the Documentation/filesystems/proc.txt and
> mm/swapfile.c in 2.6.16.62, it looks like /proc/sys/vm/pages_cluster
> has nothing to do with non-swap paging but is only used in swapfile.c.
>
> So in a system without any swap in use, changing the setting would
> have no effect.
>
> Is that correct?
>
> --
>  Ed Cashin 
>  http://noserose.net/e/

perhaps a small note first. In 2.6.30.4 source tree, the related
documentation is in Documentation/sysctl/vm.txt.

And yeap, I think the sentences are quite clear there. It only matters
if you have swap, be it swap partition or swap file.

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer
blog: the-hydra.blogspot.com

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



for swap only? /proc/sys/vm/pages_cluster

2009-09-04 Thread Ed Cashin
The way I read the Documentation/filesystems/proc.txt and
mm/swapfile.c in 2.6.16.62, it looks like /proc/sys/vm/pages_cluster
has nothing to do with non-swap paging but is only used in swapfile.c.

So in a system without any swap in use, changing the setting would
have no effect.

Is that correct?

-- 
  Ed Cashin 
  http://noserose.net/e/


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: Signal problem

2009-09-04 Thread Peter Teoh
On Thu, Sep 3, 2009 at 10:47 PM, Manish Katiyar wrote:
> On Fri, Sep 4, 2009 at 12:40 AM, vinit dhatrak wrote:
>>
>>
>> On Fri, Sep 4, 2009 at 12:29 AM, Laurentziu Dascalu
>>  wrote:
>>>
>>> 2009/9/3 Kent Tu :
>>> > Is this what you are looking for?
>>> > http://linux.die.net/man/2/signal
>>> >
>>> >
>>>
>>> No, I can't "intercept" SIGKILL with this. I still think there is some
>>> kind of hackish solution to this :-?
>
> How about having a parent process and then catching SIGCHLD ???
>

yesi think this could be a solution.   create a parent before the
child, and catches (using waitid()) SIGCHLD when the child receive
exit.   but then u must also distinguish between graceful exit vs
being killed by SIGKILL/SIGSTOP etc.

alternatively a more complicated design is this:

create a piece of shared memory between parent and child.   every
state the child transitioned...it is updated into the shared mem.   so
one way is to (many possibilities exist...just an example) catch all
signal and then for each signal caughtchange the state variable in
the shared mem.   so by deductionif the child got killed, and the
state variable does not tally with the signal state last updatedit
can be deduced that SIGKILL OR SIGSTOP is received.

-- 
Regards,
Peter Teoh

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: FS block size and Architecture Dependency

2009-09-04 Thread Greg Freemyer
On Fri, Sep 4, 2009 at 8:59 AM, Rishi Agrawal wrote:
> Hello All,
>
> I found this paragraph while understanding file systems.
>
> "
> I assume that you are setting this up with ext3 and hence my answer ties to
> this. If your filesystem is different, you should say so.
>
> Note: *In ext3, an 8K block size on the fs is only possible if you use
> Itanium and other 8K architectures. If your architecture is x86, x86_64, it
> is not possible to have a block size greater than 4k*. If you try to make an
> ext3 fs you will fail with an error message similar to this:
>
> mkfs.ext3: 8192-byte blocks too big for system (max 4096)
>
> So,if your server architecture can take it, you can
> i)use parted post installation to make the partition and then type the
> following example (if your partition is called for instance /dev/sda2):
>
> mkfs -t ext3 -b 8192 /dev/sda2
> "
> link : http://osdir.com/ml/redhat-list/2009-06/msg00131.html
>
>
> I could not figure out the dependency between the file system block size and
> the architecture.
>
> Can somebody guide me in this ?

Rishi,

I don't know the answers, but I'm pretty sure your question can be
broken into two.

1) Why does the Linux MM system restrict 32-bit kernels to 4K pages?
(Probably has to do with the MMU, but I don't know).

2) Why do most linux filesystem use disk blocks <= a memory page?  (I
suspect this is tied to the design of the block layer elevators, etc.)

fyi: I'm not sure all filesystems have that restriction.  So you may
find that 8k blocks are supported with 32-bit kernels in some
filesystems.

Greg
-- 
Greg Freemyer
Head of EDD Tape Extraction and Processing team
Litigation Triage Solutions Specialist
http://www.linkedin.com/in/gregfreemyer
Preservation and Forensic processing of Exchange Repositories White Paper -


The Norcross Group
The Intersection of Evidence & Technology
http://www.norcrossgroup.com

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: Subscription problem

2009-09-04 Thread Bian Jiang
在 2009-09-04五的 18:22 +0530,Niamathullah sharief写道:
> Hi friends,
> 
> I tried to add this mail id in "kernel newbies" mailing list
> through E-mail. But i am not getting any reply from there. I dont know
> what is the problem. Can anyone know any other way to add to this
> mailing list?
>Thank you

You are living in the Kernel newbies list.


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Subscription problem

2009-09-04 Thread Niamathullah sharief
Hi friends,
I tried to add this mail id in "kernel newbies" mailing list through
E-mail. But i am not getting any reply from there. I dont know what is the
problem. Can anyone know any other way to add to this mailing list?
   Thank you


FS block size and Architecture Dependency

2009-09-04 Thread Rishi Agrawal
Hello All,

I found this paragraph while understanding file systems.

"
I assume that you are setting this up with ext3 and hence my answer ties to
this. If your filesystem is different, you should say so.

Note: *In ext3, an 8K block size on the fs is only possible if you use
Itanium and other 8K architectures. If your architecture is x86, x86_64, it
is not possible to have a block size greater than 4k*. If you try to make an
ext3 fs you will fail with an error message similar to this:

mkfs.ext3: 8192-byte blocks too big for system (max 4096)

So,if your server architecture can take it, you can
i)use parted post installation to make the partition and then type the
following example (if your partition is called for instance /dev/sda2):

mkfs -t ext3 -b 8192 /dev/sda2
"
link : http://osdir.com/ml/redhat-list/2009-06/msg00131.html


I could not figure out the dependency between the file system block size and
the architecture.

Can somebody guide me in this ?




-- 
Regards,
Rishi B. Agrawal
http://www.linkedin.com/in/rishibagrawal
http://code.google.com/p/fscops/


Re: Fwd: disable_irq in ndo_poll_controller

2009-09-04 Thread JiSheng Zhang
Hi Michael,


2009/9/4 Michael Blizek :
>> >> 3.program nicard's register
>> >
>> > My guess without knowing or having looked at the driver is that it might
>> > tell the device to stop sending interrupts. Instead the device may be 
>> > polled
>> > if there is work to do. This reduces the load if the device would otherwise
>> > send lots of interrupts.
>> >
>>
>> Do you mix up poll_controller in netconsole and poll in NAPI?
>
> Huh?
>
> I do not really know what you mean by this question. I have not looked at

I have ask someone the same question, he mix up poll in netconsole and
NAPI.  "reduces the load" reminds me this.
> the driver, but an interrupt register in a device sounds like interrupt
> mitigation or something like this (e.g. not turning off the interrupts on
> the local CPU).
>
>        -Michi
> --

I still can't understand why need disable irq in all drivers
ndo_poll_controller implementation? and Is all the three method
equivalent?

Thanks,
Jisheng

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ