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

2012-02-20 Thread Pei Lin
在 2012年2月16日 下午9:33,黄小伟  写道:
> I know this, but I want to reclaim dynamically. Say in a shout time, several
> seconds.

http://www.kernel.org/doc/Documentation/sysctl/vm.txt
drop_caches

Writing to this will cause the kernel to drop clean caches, dentries and
inodes from memory, causing that memory to become free.

To free pagecache:
echo 1 > /proc/sys/vm/drop_caches
To free dentries and inodes:
echo 2 > /proc/sys/vm/drop_caches
To free pagecache, dentries and inodes:
echo 3 > /proc/sys/vm/drop_caches

As this is a non-destructive operation and dirty objects are not freeable, the
user should run `sync' first.

So the left thing, you could write down scripts or codes to do the
action above while detecting the operation of the device.

>
>
>
> 在 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
>



-- 
Best Regards
Lin

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


Re: pagetables used in interrupt context

2012-02-20 Thread Dave Hylands
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

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


pagetables used in interrupt context

2012-02-20 Thread subin gangadharan
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.

-- 
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: How to figure out the byteorder only with one byte number?

2012-02-20 Thread 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


Re: cgroup freezer

2012-02-20 Thread bill4carson


On 2012年02月20日 23:06, Mulyadi Santosa wrote:
> Hi Bill :)
>
> On Mon, Feb 20, 2012 at 16:50, bill4carson  wrote:
>> IMHO, when system load is high, administrator could freeze some of
>> cpu-hogged tasks in favor of more important ones, once system is most
>> likely to be idle, frozen tasks could be thaw back on line.
>
> what you describe, IIRC, is something doable via "batch" command
>
>> I don't know this idea is right or wrong, can somebody give me some
>> hints about practical usage of cgroup freezer?
>
> IMHO, it's also useful if you manage computer grid. So say you have 16
> nodes. A job runs on node A, but later you found that node C has the
> least load. You freeze the job and then unfreeze it in C.
>
Thanks for your reply :)
Just one silly question, how could frozen task be moved from node A to
C ?


> Of course, it assumes that the nodes are homogen. And yes, it sounds
> very similar to virtual machine migration. basically, both of them
> have same principle on how to get things done.
>
Yes, KVM+qemu have already support this feature.


-- 
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


Fwd: Sysctl migrate to 2.6.35

2012-02-20 Thread Rahul Kumar
-- Forwarded message --
From: Rahul Kumar
Date: Monday, February 20, 2012
Subject: Sysctl migrate to 2.6.35
To: kernelnewb...@nl.linux.org


hi,

I have userspace sysctl calls made to sysctl tables configured on a 2.6.24
kernel. I have migrated the sysctl code to 2.6.35 kernel (changed all the
sysctl table data strctures) I'm seeing warning msgs  'deprecated sysctl
warning' when i make sysctl() calls from userspace. The same is working on
2.6.24. Does anyone have any idea on this. Also, sysctl handler do_sysctl
is located in sysctl.c whereas in 2.6.35 is located in sysctl_binary.c. Do
I need to make any additional changes

Can anyone please let me know.
___
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-20 Thread THAI NGUYEN


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


Re: cgroup freezer

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

On Mon, Feb 20, 2012 at 16:50, bill4carson  wrote:
> IMHO, when system load is high, administrator could freeze some of
> cpu-hogged tasks in favor of more important ones, once system is most
> likely to be idle, frozen tasks could be thaw back on line.

what you describe, IIRC, is something doable via "batch" command

> I don't know this idea is right or wrong, can somebody give me some
> hints about practical usage of cgroup freezer?

IMHO, it's also useful if you manage computer grid. So say you have 16
nodes. A job runs on node A, but later you found that node C has the
least load. You freeze the job and then unfreeze it in C.

Of course, it assumes that the nodes are homogen. And yes, it sounds
very similar to virtual machine migration. basically, both of them
have same principle on how to get things done.

-- 
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: does anyone know how to communicate between domUs on xen?

2012-02-20 Thread rohan puri
On Mon, Feb 20, 2012 at 7:17 PM, summerxyt  wrote:

> **
> hi,
>I'm not very sure about if I can ask questions about xen here. I have
> tow questions.
>The first one is that I'm looking for methods about inter-domain
> communication for xen. I know besides network, VMs on the same physical
> machine can exchange information by event channel and grant table. But are
> these two ways working in kernel mode as part of drivers, or can I directly
> use them just like network socket in user mode?   I've tried to google it
> but only got something I can't fully understand.
>The second questions is I want to do some extra jobs (like check tcp/ip
> header and change some bits) to packages in the virtual network of xen. As
> all domUs' packages are passing the back driver of dom0, I want to put this
> extra action to network back driver of dom0. But I'm not sure which part of
> the source code has the function of receiving packages from front driver. I
> think it may be function  
> xen_netbk_tx_action.
> I'll be very appreciated if someone knows the answer. Thanks!
>
> --
> summerxyt
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
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.

-Rohan
___
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-20 Thread Subramaniam Appadodharana
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


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

2012-02-20 Thread Tao Jiang
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 bitlow bit

not only the byteorder is different, but inside a byte is also different.

But actually they are the same, right?
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


cgroup freezer

2012-02-20 Thread bill4carson

 From Documentation/cgroups/freezer-subsystem.txt, the following words
describe the purpose of cgroups freezer:

"The cgroup freezer is useful to batch job management system which start
and stop sets of tasks in order to schedule the resources of a machine
according to the desires of a system administrator."


IMHO, when system load is high, administrator could freeze some of
cpu-hogged tasks in favor of more important ones, once system is most
likely to be idle, frozen tasks could be thaw back on line.

I don't know this idea is right or wrong, can somebody give me some 
hints about practical usage of cgroup freezer?

thanks


-- 
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