Hi<div>on wed 7th sep Christopher Harvey wrote</div><div><br></div><div>>>It means that it can't be swapped to your swap partition, even if<br>>>you're not using it.</div><div> </div><div> this thing I understood it pretty well but what about the line "Therefore, every byte of</div>
<div> memory you consume is one less byte of available physical memory".What is the meaning of this line and why it is so.</div><div> <br><br><div class="gmail_quote">On Tue, Sep 6, 2011 at 9:30 PM, <span dir="ltr"><<a href="mailto:kernelnewbies-request@kernelnewbies.org">kernelnewbies-request@kernelnewbies.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Send Kernelnewbies mailing list submissions to<br>
<a href="mailto:kernelnewbies@kernelnewbies.org">kernelnewbies@kernelnewbies.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:kernelnewbies-request@kernelnewbies.org">kernelnewbies-request@kernelnewbies.org</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:kernelnewbies-owner@kernelnewbies.org">kernelnewbies-owner@kernelnewbies.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of Kernelnewbies digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. Re: Re: Regarding threaded irq and normal irq (anish singh)<br>
2. CRC calculation in Module.symvers (Shakthi Kannan)<br>
3. Re: Finding physical and logical core number in a kernel<br>
module ? (Alexandre Courbot)<br>
4. How to identify Connected USB Storage device (Harddisk, flash<br>
Memory or SSD) (mani)<br>
5. Paging of Kernel Memory (Vijay Chauhan)<br>
6. Re: Paging of Kernel Memory (Christopher Harvey)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Tue, 6 Sep 2011 13:57:22 +0530<br>
From: anish singh <<a href="mailto:anish198519851985@gmail.com">anish198519851985@gmail.com</a>><br>
Subject: Re: Re: Regarding threaded irq and normal irq<br>
To: Mulyadi Santosa <<a href="mailto:mulyadi.santosa@gmail.com">mulyadi.santosa@gmail.com</a>><br>
Cc: Greg KH <<a href="mailto:greg@kroah.com">greg@kroah.com</a>>, <a href="mailto:tglx@linutronix.de">tglx@linutronix.de</a>, sandeep kumar<br>
<<a href="mailto:coolsandyforyou@gmail.com">coolsandyforyou@gmail.com</a>>, <a href="mailto:kernelnewbies@kernelnewbies.org">kernelnewbies@kernelnewbies.org</a><br>
Message-ID:<br>
<CAK7N6voUN+b8nj=nQNoU1wGVr=<a href="mailto:b9jCm%2B0Q43eHg7bPLcgB4Nzw@mail.gmail.com">b9jCm+0Q43eHg7bPLcgB4Nzw@mail.gmail.com</a>><br>
Content-Type: text/plain; charset=UTF-8<br>
<br>
On Tue, Sep 6, 2011 at 10:59 AM, anish singh<br>
<<a href="mailto:anish198519851985@gmail.com">anish198519851985@gmail.com</a>> wrote:<br>
> On Tue, Sep 6, 2011 at 10:51 AM, Mulyadi Santosa<br>
> <<a href="mailto:mulyadi.santosa@gmail.com">mulyadi.santosa@gmail.com</a>> wrote:<br>
>> Hi :)<br>
>><br>
>> On 06/09/2011, sandeep kumar <<a href="mailto:coolsandyforyou@gmail.com">coolsandyforyou@gmail.com</a>> wrote:<br>
>>> Hmm..But when i tried to take a mutex lock in threaded_irq, it is throwing a<br>
>>> warning message<br>
>>> "BUG: sleeping function called from invalid context"... So i was wondering<br>
>>> which way it is..<br>
>><br>
>> Please don't top post :)<br>
>><br>
>> Anyway, regarding that "BUG:" message, could it be that mutex function<br>
>> mistakenly assume it's called inside top half, thus bails out since<br>
> How can mutex assume? IMHO the message would have printed<br>
> because sleeping would be forbidden there but again AFAIK in the threaded<br>
> handler we can do I2C transactions which can sleep.So kind of<br>
> paradox there.<br>
<br>
>>something like using in_irq() inside the threaded irq handler?<br>
I think after going thorough the code of mutex_lock we can find out the<br>
reason why it is printing the warning eventhough we are calling it in a<br>
threaded handler i.e. kernel thread.<br>
<br>
>From the code:<br>
126 /**<br>
127 * might_sleep - annotation for functions that can sleep<br>
128 *<br>
129 * this macro will print a stack trace if it is executed in an atomic<br>
130 * context (spinlock, irq-handler, ...).<br>
<br>
129 line no is important.<br>
This might_sleep is called by mutex_lock function and in the defintion<br>
of __might_sleep i found below code.I think this below if condition is<br>
false because irqs_disabled is true.This causes the warning.<br>
<br>
if ((preempt_count_equals(preempt_offset) && !irqs_disabled()) ||<br>
system_state != SYSTEM_RUNNING || oops_in_progress)<br>
return;<br>
<br>
Hope i am right?<br>
<br>
> ps:I have seen the code where sandeep is doing the taking the mutex lock.<br>
> He is taking mutex lock at the beginging of the handler and releasing<br>
> at the end.<br>
>> sleeping is forbidden there? which mutex function do you use? (sorry I<br>
>> don't follow every locking functions exist now)<br>
>><br>
>> --<br>
>> regards,<br>
>><br>
>> Mulyadi Santosa<br>
>> Freelance Linux trainer and consultant<br>
>><br>
>> blog: <a href="http://the-hydra.blogspot.com" target="_blank">the-hydra.blogspot.com</a><br>
>> training: <a href="http://mulyaditraining.blogspot.com" target="_blank">mulyaditraining.blogspot.com</a><br>
>><br>
>> _______________________________________________<br>
>> Kernelnewbies mailing list<br>
>> <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
>> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
>><br>
><br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Tue, 6 Sep 2011 12:41:24 +0530<br>
From: Shakthi Kannan <<a href="mailto:shakthimaan@gmail.com">shakthimaan@gmail.com</a>><br>
Subject: CRC calculation in Module.symvers<br>
To: <a href="mailto:kernelnewbies@kernelnewbies.org">kernelnewbies@kernelnewbies.org</a><br>
Message-ID:<br>
<CABG-yt2W02ToqJJ=-<a href="mailto:n773Lg-JCRnDYc7qzA0HsCw%2BmorgnSx8Q@mail.gmail.com">n773Lg-JCRnDYc7qzA0HsCw+morgnSx8Q@mail.gmail.com</a>><br>
Content-Type: text/plain; charset=UTF-8<br>
<br>
Greetings!<br>
<br>
I would like to know as to:<br>
<br>
1. How the CRC is computed for an exported symbol in the Linux kernel, and<br>
2. Given a kernel .c file, how can I obtain the CRC checksums for a symbol.<br>
<br>
For linux-3.0.2 (example), I compiled with CONFIG_MODVERSIONS=y, and<br>
running make built vmlinux, and generated the Module.symvers file. I<br>
believe genksyms is used to generate the CRC information.<br>
<br>
I had referred the "Kernel Symbols and CONFIG_MODVERSIONS"<br>
documentation [1] written by Mark McLoughlin. I tried the following in<br>
the top-level kernel sources:<br>
<br>
$ gcc -E -D__GENKSYMS__ -DCONFIG_MODVERSIONS -DEXPORT_SYMTAB<br>
crypto/api.c -I/tmp/linux-3.0.2/include<br>
-I/tmp/linux-3.0.2/arch/x86/include | ./scripts/genksyms/genksyms<br>
<br>
and I get the following error output:<br>
<br>
=== Output ===<br>
<br>
/tmp/linux-3.0.2/include/linux/jiffies.h:43:42: error: division by zero in #if<br>
In file included from /tmp/linux-3.0.2/include/linux/tracepoint.h:19:0,<br>
from /tmp/linux-3.0.2/include/linux/module.h:18,<br>
from crypto/api.c:22:<br>
/tmp/linux-3.0.2/include/linux/rcupdate.h:160:2: error: #error<br>
"Unknown RCU implementation specified to kernel configuration"<br>
In file included from /tmp/linux-3.0.2/include/linux/module.h:21:0,<br>
from crypto/api.c:22:<br>
/tmp/linux-3.0.2/arch/x86/include/asm/module.h:59:2: error: #error<br>
unknown processor family<br>
<br>
=== End ===<br>
<br>
The documentation for genksyms is old, and now there is no -k option?<br>
<br>
Appreciate any inputs in this regard,<br>
<br>
Thanks!<br>
<br>
SK<br>
<br>
[1] Kernel Symbols and CONFIG_MODVERSIONS.<br>
<a href="http://www.skynet.ie/~mark/pub/symbols.txt" target="_blank">http://www.skynet.ie/~mark/pub/symbols.txt</a><br>
<br>
--<br>
Shakthi Kannan<br>
<a href="http://www.shakthimaan.com" target="_blank">http://www.shakthimaan.com</a><br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Tue, 6 Sep 2011 16:14:19 +0900<br>
From: Alexandre Courbot <<a href="mailto:gnurou@gmail.com">gnurou@gmail.com</a>><br>
Subject: Re: Finding physical and logical core number in a kernel<br>
module ?<br>
To: Vaibhav Jain <<a href="mailto:vjoss197@gmail.com">vjoss197@gmail.com</a>><br>
Cc: <a href="mailto:kernelnewbies@kernelnewbies.org">kernelnewbies@kernelnewbies.org</a><br>
Message-ID:<br>
<CAAVeFu+h9=-<a href="mailto:roQcJaoh_d4XNbm8BtqtbQRR7qrWgx0B-k27dHA@mail.gmail.com">roQcJaoh_d4XNbm8BtqtbQRR7qrWgx0B-k27dHA@mail.gmail.com</a>><br>
Content-Type: text/plain; charset=UTF-8<br>
<br>
> I agree that the kernel module is not restricted to any core but is it<br>
> possible that whenever it is executed<br>
> it gives the core number whichever is executing it ?<br>
<br>
Have a look at the end of include/linux/smp.h: smp_processor_id()<br>
gives you the number of the current executing CPU. get_cpu() will do<br>
the same and will also disable preemption so that you will stay on<br>
that CPU until put_cpu() is called.<br>
<br>
>From user-space, you can use sched_getcpu() to obtain the same information.<br>
<br>
Hope this helps,<br>
Alex.<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Tue, 6 Sep 2011 16:02:33 +0530<br>
From: mani <<a href="mailto:manishrma@gmail.com">manishrma@gmail.com</a>><br>
Subject: How to identify Connected USB Storage device (Harddisk, flash<br>
Memory or SSD)<br>
To: <a href="mailto:kernelnewbies@kernelnewbies.org">kernelnewbies@kernelnewbies.org</a><br>
Message-ID:<br>
<CAB+TZU93_edNTfbNVKvQdgWiJxDTNHWWunNT6VNbHP+=<a href="mailto:RTixfw@mail.gmail.com">RTixfw@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Hi all,<br>
<br>
Is there any way to find out the type of the connected USB disk (Hard<br>
disk/SDD)?<br>
<br>
AFAIK there is a significant performance difference in Harddisk/SDD devices.<br>
<br>
Previously i though that the rotational flag in the sysfs will distinguish<br>
them but it is same for both the types<br>
<br>
#cat /sys/block/sda/queue/rotational<br>
1 for both flash & HDD<br>
<br>
Is there any way to distinguish the USB Harddisk or SDD drives ?<br>
<br>
Thanks & Regards,<br>
Manish<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110906/f2bd2875/attachment-0001.html" target="_blank">http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110906/f2bd2875/attachment-0001.html</a><br>
<br>
------------------------------<br>
<br>
Message: 5<br>
Date: Tue, 6 Sep 2011 17:48:12 +0530<br>
From: Vijay Chauhan <<a href="mailto:kernel.vijay@gmail.com">kernel.vijay@gmail.com</a>><br>
Subject: Paging of Kernel Memory<br>
To: <a href="mailto:kernelnewbies@kernelnewbies.org">kernelnewbies@kernelnewbies.org</a><br>
Message-ID:<br>
<<a href="mailto:CAJ61zBDd4tH7jn2YEpDSmbaTXODUqpjOKanPsk0sqgHbKyek8w@mail.gmail.com">CAJ61zBDd4tH7jn2YEpDSmbaTXODUqpjOKanPsk0sqgHbKyek8w@mail.gmail.com</a>><br>
Content-Type: text/plain; charset=ISO-8859-1<br>
<br>
Hi,<br>
<br>
i was going through the Linux Kernel Development book. It mention the following:<br>
<br>
"Additionally, kernel memory is not pageable.Therefore, every byte of<br>
memory you consume is one less byte of available physical memory."<br>
<br>
What is the meaning of 'Kernel memory is not pageable'? Anyone can<br>
give details would help me in understanding.<br>
<br>
Thanks,<br>
Vijay<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 6<br>
Date: Tue, 06 Sep 2011 09:38:26 -0500<br>
From: Christopher Harvey <<a href="mailto:chris@basementcode.com">chris@basementcode.com</a>><br>
Subject: Re: Paging of Kernel Memory<br>
To: <<a href="mailto:kernelnewbies@kernelnewbies.org">kernelnewbies@kernelnewbies.org</a>><br>
Message-ID: <<a href="mailto:1d7f4b0da950c823cb12c54a4d555234@basementcode.com">1d7f4b0da950c823cb12c54a4d555234@basementcode.com</a>><br>
Content-Type: text/plain; charset=UTF-8; format=flowed<br>
<br>
On Tue, 6 Sep 2011 17:48:12 +0530, Vijay Chauhan wrote:<br>
> Hi,<br>
><br>
> i was going through the Linux Kernel Development book. It mention the<br>
> following:<br>
><br>
> "Additionally, kernel memory is not pageable.Therefore, every byte of<br>
> memory you consume is one less byte of available physical memory."<br>
><br>
> What is the meaning of 'Kernel memory is not pageable'? Anyone can<br>
> give details would help me in understanding.<br>
><br>
> Thanks,<br>
> Vijay<br>
><br>
It means that it can't be swapped to your swap partition, even if<br>
you're not using it.<br>
<br>
<br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br>
<br>
End of Kernelnewbies Digest, Vol 10, Issue 8<br>
********************************************<br>
</blockquote></div><br></div>