Re: pagetables used in interrupt context

2012-02-21 Thread subin gangadharan
Thank you for clearing my doubt.

On Mon, Feb 20, 2012 at 8:39 PM, Dave Hylands  wrote:
> Hi Subin,
>
> On Mon, Feb 20, 2012 at 6:47 PM, subin gangadharan
>  wrote:
>> Hi All,
>>
>> Please correct me if I am wrong. In linux each process will have its
>> own page tables, so when a interrupt happens processor will switch to
>> interrupt context
>> and execute the proper handler. So my doubt, if this is the case,
>> interrupt hanlder will be using the pagetables of the interrupted
>> process or is there a separate page table for this.
>
> Yep - that's right. Conceptually you can imagine that the kernel page
> tables are replicated in each process, so when the interrupt occurs,
> the kernel mappings will always be in effect regardless of which task
> is running. How this is actually achieved may vary from architecture
> to architecture.
>
> --
> Dave Hylands
> Shuswap, BC, Canada
> http://www.davehylands.com



-- 
With Regards
Subin Gangadharan

I am not afraid and I am also not afraid of being afraid.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: cgroup freezer

2012-02-21 Thread bill4carson


On 2012年02月22日 01:08, Mulyadi Santosa wrote:
> Hi Bill :)
>
> On Tue, Feb 21, 2012 at 08:23, bill4carson  wrote:
>> Just one silly question, how could frozen task be moved from node A to
>> C ?
>
> I forgot to mention that I haven't tried the freezer feature in Linux
> kernel, but I got impression that is quite similar with so called
> checkpointing.
>
> So assuming that it's indeed checkpointing, what you need to do is
> just grab the checkpointed image, copy to another node and execute a
> command to unfreeze it. Usually, the image could be similar with ELF
> dump core, but it could be something else too.
>
Thanks for your information, I'll make some time to try what checkpoint
does.



-- 
I am a slow learner
but I will keep trying to fight for my dreams!

--bill

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: cgroup freezer

2012-02-21 Thread Mulyadi Santosa
Hi Bill :)

On Tue, Feb 21, 2012 at 08:23, bill4carson  wrote:
> Just one silly question, how could frozen task be moved from node A to
> C ?

I forgot to mention that I haven't tried the freezer feature in Linux
kernel, but I got impression that is quite similar with so called
checkpointing.

So assuming that it's indeed checkpointing, what you need to do is
just grab the checkpointed image, copy to another node and execute a
command to unfreeze it. Usually, the image could be similar with ELF
dump core, but it could be something else too.

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Semaphore

2012-02-21 Thread Dave Hylands
Hi Santosh,

On Tue, Feb 21, 2012 at 5:47 AM, SaNtosh kuLkarni
 wrote:
> A certain  kernel process has acquired a semaphore lock and meanwhile during
> this period the process gets killed abruptly (and it has not released the
> sem lock..//.sem down).and the other processes cannot acquire the lock,
> what can be done in this case.

Normally, the semaphore would be associated with a driver of some
type. If the process opened the driver, then regardless of how the
process dies, the file that was opened by the process will eventually
be closed by the kernel and the driver's release function will get
called. This gives you the opportunity to release the semaphore. The
driver would be responsible for tracking the state of the semaphore.
Fundamentally the driver is responsible for cleaning up all of the
resources that it may be using, and a semaphore is just another
resource, like memory.

I'm assuming that the semaphore is one which is held across multiple
calls into the kernel, otherwise you don't have an issue in the first
place, unless there is a bug on the kernel side of things which
actually caused the process to terminate.

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: The 2.6.32 Linux kernel patches

2012-02-21 Thread Greg KH
On Tue, Feb 21, 2012 at 01:15:48PM +0300, mzee mzee wrote:
> Hi, I'm a newbie to the Linux kernel, working on Android msm kernel. Due
> to the hack on kernel.org, there was re-organization of if
> infrastructure, as a result I couldn't find the 2.6.32 ALL incremental
> patches, although I found a few, after long poking around at:
> 
> > http://www.kernel.org/pub/linux/kernel/v2.6/longterm/v2.6.32/incr/
> 
> 
> 
> 
> 
>  
> 
> The only ones there are from 27-28 to 55-56, where may find the rest?

They aren't there, sorry, use the git tree to create them yourself if
you really need them.

sorry,

greg k-h

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Semaphore

2012-02-21 Thread Konstantin Zertsekel
On Tue, Feb 21, 2012 at 3:47 PM, SaNtosh kuLkarni
 wrote:
> A certain kernel process has acquired a semaphore lock and meanwhile during 
> this period
> the process gets killed abruptly (and it has not released the sem 
> lock..//.sem down).
> and the other processes cannot acquire the lock, what can be done in this 
> case.

The only check I see is debug_check_no_locks_held() in kernel/exit.c
file, do_exit().
But it seems to be relevant only for 'CONFIG_LOCKDEP'...
Does anyone know the correct answer?

Thanks,
--- KostaZ

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Semaphore

2012-02-21 Thread SaNtosh kuLkarni
A certain  kernel process has acquired a semaphore lock and meanwhile
during this period the process gets killed abruptly (and it has not
released the sem lock..//.sem down).and the other processes cannot
acquire the lock, what can be done in this case.

-- 
*Regards,
Santosh Kulkarni*
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re:Re: How to clean up buffer or cache momory?

2012-02-21 Thread 黄小伟
I know, but it can not allocate all the cache memory, so you will fail 
sometimes if the memory has not been reclaimed.





在 2012-02-17 15:13:18,"Wang Chao"  写道:
>On 02/16/12 at 09:33pm, 黄小伟 wrote:
>> I know this, but I want to reclaim dynamically. Say in a shout time, several 
>> seconds.
>Why do want to do that? Does it have a bad influence on performance?
>Kernel will reclaim these cache itself when your machine runs out of mm.
>> 
>> 
>> 
>> 
>> 
>> 在 2012-02-16 21:21:11,"Manish Katiyar"  写道:
>> >2012/2/16 黄小伟 :
>> >>  Hi
>> >>  I encounter a problem recentely. My system supports USB strorage and
>> >> other network applications.
>> >>  But after I put a file to usb storage, it will consume some many
>> >> momory.
>> >> (buffer + cache).
>> >>  And these buffered memory can not be reclaimed(use free command).
>> >> So I want to know how to reclaim the buffer memory in a short time.
>> >
>> >Google for ./sys/vm/drop_caches
>> >
>> >-- 
>> >Thanks -
>> >Manish
>> >
>> >___
>> >Kernelnewbies mailing list
>> >Kernelnewbies@kernelnewbies.org
>> >http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>> ___
>> Kernelnewbies mailing list
>> Kernelnewbies@kernelnewbies.org
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
>-- 
>Thanks,
>Chao Wang
>
>___
>Kernelnewbies mailing list
>Kernelnewbies@kernelnewbies.org
>http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How to figure out the byteorder only with one byte number?

2012-02-21 Thread Bernd Petrovitsch
On Die, 2012-02-21 at 20:30 +0800, Tao Jiang wrote:
[...]
> Now I know in the most modern machine there is no difference between BE and LE
> at so called 'bit order' level.
> Right?

One main difference between *byte* order and *bit* order is:

What are the means to address individual *bits*?
a) Bit shift and masking as in "1 << bit-number":
   This has a mathematical background and - implicitly - the
   least-significant bit has - thus - the number 0.
   I can't even think of an insane reason (let alone a sane one) to
   break the "shift left is for unsigned numbers equivalent to
   doubling" property - apart from the fact that it is defined in that
   way by C - and all other languages I came across. And the same holds
   for all CPUs/assembler instruction sets 
b) use a bit-field as in "unsigned char b0:1, b1:1, b2:1, b3:1, b4:1,
   b5:1, b6:1, b7:1;":
   It is not defined by any C-standard and is - thus - up to the
   compiler, if b0 == (1 << 0) or b0 == (1 << 7) or anything else.
c) bit-test/st/clr assembler instructions in the architecture: Go read
   *if* your CPU has such stuff and how it relates to the "bit-shift and
   mask" method.
   I would be greatly surprised if it is different (on i386, it is equal
   since ages BTW) mainly because it makes absolutely no sense.
d) There is hardware with bit-addressable memory out there. Go read the
   manual and the same as c)
I doubt that it is different even for really old machines 

Bernd
-- 
Bernd Petrovitsch  Email : be...@petrovitsch.priv.at
 LUGA : http://www.luga.at


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How to figure out the byteorder only with one byte number?

2012-02-21 Thread Tao Jiang
Hi:

I think I'm clear now.
What's I originally wanted to ask for is whether 'bit order' equals to
'byte order'
And is there a method to find out the 'bit order' then find out the
'byte order' ?

Now I know in the most modern machine there is no difference between BE and LE
at so called 'bit order' level.
Right?

Thank you all.


2012/2/21 Sri Ram Vemulpali :
> Guys,
>
> I was late to the party. But this whole  discussion throughs me off.
> When you say byte order, it applied when the width of data is more
> than a byte, lets say our width is 4 bytes, a typical word length.
>
> Now how is that there will be byte order on a byte width data. Are you
> talking about nibble order.
>
> When you talk byte order -- either little endian or big endian, we are
> talking how is our data should be interpreted. Depending on order we
> start reading data from left or right a byte at a time.
>
> So, I am confused on your discussions. Please clarify.
>
> Thanks,
> Sri.
>
> On Mon, Feb 20, 2012 at 5:32 PM, THAI NGUYEN  wrote:
>>
>> Just as an FYI, way back in the early '90s, Texas Instruments came out with
>> a graphics processor (I believe the TMS340x0 praphics processor) that
>> actually did do the little-ending and big-endian down to the bit level.
>>
>>
>> 
>> From: Subramaniam Appadodharana 
>> To: Tao Jiang 
>> Cc: Graeme Russ ; Bernd Petrovitsch
>> ; Peter Senna Tschudin ;
>> kernelnewbies@kernelnewbies.org
>> Sent: Monday, February 20, 2012 8:53:10 AM
>> Subject: Re: How to figure out the byteorder only with one byte number?
>>
>> Hi Tao,
>>
>>
>> On Mon, Feb 20, 2012 at 5:25 AM, Tao Jiang  wrote:
>>> Hi:
>>>
>>> Thank you all.
>>>
>>> Take a byte number 0b0001 for example
>>>                                     ^             ^
>>>                               high bit     low bit
>>>
>>> I used to think in a LE machine it will be stored as 0b1000 low bit
>>> first
>>>
>>>            ^             ^
>>>
>>>        low bit     high bit
>>>
>>> and in a BE machine will be 0b0001 high bit first
>>>                                                ^             ^
>>>                                             high bit    low bit
>>>
>>> not only the byteorder is different, but inside a byte is also different.
>>>
>>> But actually they are the same, right?
>> yes they are same. In fact it is termed as 'byte' order not 'bit'
>> order. Hope this helps.
>>> Thank you.
>>>
>>>
>>>
>>> 2012/2/20 Graeme Russ :
 On 02/20/2012 01:24 AM, Bernd Petrovitsch wrote:
> On Sun, 2012-02-19 at 20:08 +0800, Tao Jiang wrote:
> [...]
>> Is there some difference of the storge between BE and LE machine inside
>> a byte?
>
> No. At least TTBOMK there exists no such hardware.

 Using SHL/SHR would tell you - SHL normally results in a multiply by 2,
 SHR
 a divide by 2. If the byte was little endian, the results would be
 visa-versa

 But I agree, I doubt there is any such hardware

 Regards,

 Graeme

>>>
>>> ___
>>> Kernelnewbies mailing list
>>> Kernelnewbies@kernelnewbies.org
>>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
>> ___
>> Kernelnewbies mailing list
>> Kernelnewbies@kernelnewbies.org
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
>>
>>
>> ___
>> Kernelnewbies mailing list
>> Kernelnewbies@kernelnewbies.org
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
>
>
>
> --
> Regards,
> Sri.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Fwd: Linux kernel : sysctl registering table under same proc name (path)

2012-02-21 Thread chaitanya g
Hello there,



I am creating a sysctl kernel module to register 2 hierarchy under same
proc name. For e.g.



  my_net

  |  |

net1  net2

 | |

t1t2



So, I used register_sysctl_paths() API for registering the sysctl tables
net1 net2 under path name my_net.



Problem is when unregistering the tables dmesg shows a warning and call
trace.



# rmmod  sysctl.ko

# dmesg

[ cut here ]

WARNING: at kernel/sysctl.c:2270 unregister_sysctl_table+0xb1/0x120()
(Tainted: PW   )

Hardware name: VMware Virtual Platform

Modules linked in: sysctl(-)(U) ip6table_filter ip6_tables ebtable_nat
ebtables xt_CHECKSUM iptable_mangle ipt_MASQUERADE iptable_nat nf_nat
nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack ipt_REJECT bridge
autofs4 sunrpc fcoe libfcoe libfc scsi_transport_fc scsi_tgt 8021q garp stp
llc cachefiles fscache ipv6 xt_physdev iptable_filter ip_tables dm_mirror
dm_region_hash dm_log uinput ppdev parport_pc parport e1000 pcnet32 mii
vmware_balloon sg i2c_piix4 i2c_core shpchp ext4 mbcache jbd2 vxspec(P)(U)
vxio(P)(U) vxdmp(P)(U) sd_mod crc_t10dif sr_mod cdrom mptspi mptscsih
mptbase scsi_transport_spi ata_generic pata_acpi ata_piix dm_mod [last
unloaded: sysctl]

Pid: 22463, comm: rmmod Tainted: PW  
 2.6.32-71.el6.x86_64 #1

Call Trace:

 [] warn_slowpath_common+0x87/0xc0

 [] warn_slowpath_null+0x1a/0x20

 [] unregister_sysctl_table+0xb1/0x120

 [] ? stop_machine_destroy+0x4c/0x50

 [] ? stop_machine+0x4b/0x60

 [] sysctl_module_exit+0x21/0x23 [sysctl]

 [] sys_delete_module+0x1a6/0x280

 [] ? syscall_trace_enter+0x1d8/0x1e0

 [] tracesys+0xd9/0xde

---[ end trace fee2c1c8e41aeb36 ]---





Kindly, help me to resolve this warning.





Following is module.



#include 

#include 

#include 





static struct ctl_table_header * test_sysctl_header1;

static struct ctl_table_header * test_sysctl_header2;



int value1 = 0;

int value2 = 1;

int min = 10;

int max = 20;



static ctl_table test_table1[] = {

{


.ctl_name = CTL_UNNUMBERED,


.procname   = "value1",


.data = &value1,


.maxlen  = sizeof(int),


.mode = 0644,

.proc_handler
= &proc_dointvec_minmax,

.strategy=
&sysctl_intvec,

.extra1 = &min,

.extra2 = &max

},

{


.ctl_name = CTL_UNNUMBERED,


.procname   = "value2",


.data = &value2,


.maxlen  = sizeof(int),


.mode = 0644,

.proc_handler
= &proc_dointvec_minmax,

.strategy=
&sysctl_intvec,

.extra1 = &min,

.extra2 = &max

},

{ .ctl_name = 0 }

};



static ctl_table test_table2[] = {

{


.ctl_name = CTL_UNNUMBERED,


.procname   = "value1",


.data = &value1,


.maxlen  = sizeof(int),


.mode = 0644,

.proc_handler
= &proc_dointvec_minmax,

.strategy=
&sysctl_intvec,

.extra1 = &min,

.extra2 = &max

},

{


.ctl_name = CTL_UNNUMBERED,


.procname   = "value2",


.data = &value2,


.maxlen  = sizeof(int),


.mode = 0644,

.proc_handler
= &proc_dointvec_minmax,

.strategy=
&sysctl_intvec,

.extra1 = &min,

.extra2 = &max

},

{ .ctl_name = 0 }

};



static ctl_table test_net_table1[] = {

{


.ctl_name = CTL_UNNUMBERED,


.procname   = "test1",


.mode = 0555,


.child   = test_table1

},

  

The 2.6.32 Linux kernel patches

2012-02-21 Thread mzee mzee
Hi, I'm a newbie to the Linux kernel, working on Android msm kernel. Due
to the hack on kernel.org, there was re-organization of if
infrastructure, as a result I couldn't find the 2.6.32 ALL incremental
patches, although I found a few, after long poking around at:

> http://www.kernel.org/pub/linux/kernel/v2.6/longterm/v2.6.32/incr/






The only ones there are from 27-28 to 55-56, where may find the rest?

Also I'm new to git, does  any one have a good tutorial on this with
focus on Linux kernel development?

Thanks
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Re: does anyone know how to communicate between domUs on xen?

2012-02-21 Thread summerxyt
>Check the website of xen, they might have something. One which I knew was
>xensocket, but I guess you would need to port it to latest xen kernel as it
>was not part of it. There may be other mechanisms also.

Thanks! But the truth is I've tried to search material on the official website 
of xen, but didn't get what i want. 
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies