Tracing memory address access in kernel

2018-12-04 Thread Pritam Bankar
Hello,

I am facing issue of memory corruption where only one field of
allocated structure is getting corrupted. I have bio structure and one
of the page in bio vector is getting set to NULL.

crash> struct bio_vec 0x88009dc5eb00

struct bio_vec {
  bv_page = 0xea000a434b80,
  bv_len = 4096,
  bv_offset = 0
}

crash> struct bio_vec 0x88009dc5eb10
struct bio_vec {
  bv_page = 0x0,
  bv_len = 4096,
  bv_offset = 0

}

crash> struct bio_vec 0x88009dc5eb20
struct bio_vec {
  bv_page = 0xea000a467500,
  bv_len = 4096,
  bv_offset = 0

}

I have allocated contagious memory for bio vectors. As you can see in
second bio vector bv_page is getting set to NULL. This address is
valid till the time I do some operations in my module. After some
operations bv_page is getting set to NULL. Other fields are having
valid data.

Is there any debugging technique / tool available which will track
access to specific memory access?  I would like to dump stack every
time bv_page is accessed or modified

Thanks and regards,
Pritam Bankar

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


System call service routine and interrupt context

2018-04-30 Thread Pritam Bankar
Hi,

My question is, do all the code of interrupt handler in system call
gets executed in interrupt context?

System calls generate software interrupts. So when I do open() syscall
it we call do_sys_open()  handler which will eventually call file
system specific open function call. Will all this happen in interrupt
context until I get open file descriptor in user land?

If not when does context change?


Thanks and regards,
Pritam Bankar

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


Re: user space vs kernel space address space

2013-12-31 Thread Pritam Bankar
Thanks Miles, I was in assumption that every physical HAS to be mapped in
some kernel virtual address. I have come across one more doubt please see
my comments inline.






 On Sun, Dec 29, 2013 at 7:04 PM, Miles MH Chen orca.c...@gmail.comwrote:

 Hi Pritam,

 1) Yes, all 512RAM will be direct mapped to kernel address space IF the
 kernel have a 896MB direct mapping area.
 Actually you can change the range of kernel direct mapping by the
 vmalloc=size in boot command line.
 In 32-bit and 3:1 split configuration, kernel direct mapping area +
 vmalloc area is roughly 1G.

 2) User space and kernel space can have different virtual addresses
 mapping to the same physical frame at the same time.


How above scenario of user space and kernel space having
mapping to the same physical frame   is handled. This would be
like sharing kernel data with user which is not allowed.




 3) Direct mapped or fixed map or permanent map are describing kernel
 VIRTUAL address space, you can see the virtual memory
 layout by 'dmesg'. When user space needs memory, the kernel allocates a
 free memory frame, and remaps the frame to user space.
 The frame does not have to have a valid kernel virtual address.



 But all physical memory/frames are eventually controlled by kernel , then
 how can there ever exist a frame which doesn't have mapping with kernel or
 kernel virtual address ?




  Regards,
 MH


 On Sun, Dec 29, 2013 at 5:42 PM, Pritam Bankar 
 pritambankar1...@gmail.com wrote:

 Lets consider 32 bit Linux system with 512 physical RAM. Suppose I have
 standard 3:1 address space split. Now what I understand is

 (In general)
 1. In the fourth gigabyte I have kernel space
 2. Out of 1GB for kernel address space only 896MB is used as direct
 mapping and other 128 MB is used for Noncontiguous Memory Area Management,
 Fixed Mapping and Permanent Mapping.

 PCMIIW

 Following are my doubts :
 1. Since my system has only 512MB RAM, will there be only direct
 mappings since 896 is enough to hold 512 RAM?
 2. When user space program do malloc, we get some virtual address from
 userspace region (from first 3GB) of process. So will it be like, when I
 access some memory from that region, there is some physical frame
 associated with it AND same physical frame will also be mapped in kernel
 space ?
 So what I want  to know, for every physical frame is there a mapping in
 userspace as well as kernel space ? (given that some address in user space
 of process map to same physical frame)
 3. If we consider example of Linux system with 4GB, now if I do malloc
 from user space from which memory region kernel will give memory ? Direct
 mapped region or fixed map or permanent map ?

 Thanks and regards,
 Pritam Bankar

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




 Thanks and regards,
 Pritam Bankar



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


Re: user space vs kernel space address space

2013-12-30 Thread Pritam Bankar
Miles thanks a lot for response but I still have some doubts please see my
comments inline.



On Sun, Dec 29, 2013 at 7:04 PM, Miles MH Chen orca.c...@gmail.com wrote:

 Hi Pritam,

 1) Yes, all 512RAM will be direct mapped to kernel address space IF the
 kernel have a 896MB direct mapping area.
 Actually you can change the range of kernel direct mapping by the
 vmalloc=size in boot command line.
 In 32-bit and 3:1 split configuration, kernel direct mapping area +
 vmalloc area is roughly 1G.

 2) User space and kernel space can have different virtual addresses
 mapping to the same physical frame at the same time.

 3) Direct mapped or fixed map or permanent map are describing kernel
 VIRTUAL address space, you can see the virtual memory
 layout by 'dmesg'. When user space needs memory, the kernel allocates a
 free memory frame, and remaps the frame to user space.
 The frame does not have to have a valid kernel virtual address.



But all physical memory/frames are eventually controlled by kernel , then
how can there ever exist a frame which doesn't have mapping with kernel or
kernel virtual address ?




 Regards,
 MH


 On Sun, Dec 29, 2013 at 5:42 PM, Pritam Bankar pritambankar1...@gmail.com
  wrote:

 Lets consider 32 bit Linux system with 512 physical RAM. Suppose I have
 standard 3:1 address space split. Now what I understand is

 (In general)
 1. In the fourth gigabyte I have kernel space
 2. Out of 1GB for kernel address space only 896MB is used as direct
 mapping and other 128 MB is used for Noncontiguous Memory Area Management,
 Fixed Mapping and Permanent Mapping.

 PCMIIW

 Following are my doubts :
 1. Since my system has only 512MB RAM, will there be only direct mappings
 since 896 is enough to hold 512 RAM?
 2. When user space program do malloc, we get some virtual address from
 userspace region (from first 3GB) of process. So will it be like, when I
 access some memory from that region, there is some physical frame
 associated with it AND same physical frame will also be mapped in kernel
 space ?
 So what I want  to know, for every physical frame is there a mapping in
 userspace as well as kernel space ? (given that some address in user space
 of process map to same physical frame)
 3. If we consider example of Linux system with 4GB, now if I do malloc
 from user space from which memory region kernel will give memory ? Direct
 mapped region or fixed map or permanent map ?

 Thanks and regards,
 Pritam Bankar

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




Thanks and regards,
Pritam Bankar
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


user space vs kernel space address space

2013-12-29 Thread Pritam Bankar
Lets consider 32 bit Linux system with 512 physical RAM. Suppose I have
standard 3:1 address space split. Now what I understand is

(In general)
1. In the fourth gigabyte I have kernel space
2. Out of 1GB for kernel address space only 896MB is used as direct mapping
and other 128 MB is used for Noncontiguous Memory Area Management, Fixed
Mapping and Permanent Mapping.

PCMIIW

Following are my doubts :
1. Since my system has only 512MB RAM, will there be only direct mappings
since 896 is enough to hold 512 RAM?
2. When user space program do malloc, we get some virtual address from
userspace region (from first 3GB) of process. So will it be like, when I
access some memory from that region, there is some physical frame
associated with it AND same physical frame will also be mapped in kernel
space ?
So what I want  to know, for every physical frame is there a mapping in
userspace as well as kernel space ? (given that some address in user space
of process map to same physical frame)
3. If we consider example of Linux system with 4GB, now if I do malloc from
user space from which memory region kernel will give memory ? Direct mapped
region or fixed map or permanent map ?

Thanks and regards,
Pritam Bankar
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Query regarding physically discontiguous memory

2013-12-26 Thread Pritam Bankar
On Wed, Dec 25, 2013 at 9:07 PM, valdis.kletni...@vt.edu wrote:

 On Wed, 25 Dec 2013 14:45:01 +0530, Pritam Bankar said:

  This is what I don't understand what does it mean by
 
  containing large holes?
 
  physical discontiguous memory?
 
  Is it like when I put 2 RAM chips in a system then memory for them will
 be
  discontiguous?

  Per my understanding RAM memory will ALWAYS be contiguous whether its 512
  MB or 4 GB.

 Your understanding is wrong.  That may be true on most x86-based desktops
 and laptops and the like, but it's often very wrong on other architectures.
 In fact, given that the x86 architecture is just one of like 27 archs that
 Linux supports, it's a good bet that there's more archs that *don't*
 enforce
 contiguous memory than do. Counting through the defconfigs to get a number
 is left as an exercise for the student. :)

 A common case for embedded systems is 256M of RAM at address 0, and
 256M of RAM at address 0x8000 (or whatever the halfway mark for the
 architecture is).

 NUMA boxes are sometimes each node's RAM is at node number*4G or
 similar,
 which means lots of holes if each node is partly populated with only 2G.



Thanks a lot Saptarshi and Valdis. Your comments cleared my doubt but while
doing some more analysis I have come with following points.

Following is a output of /proc/iomem on my system

*
[pritam@linux-box-1 ~]$ cat /proc/iomem
-0009fbff : *System RAM*
  - : Crash kernel
0009fc00-0009 : reserved
000a-000b : Video RAM area
000c-000c7fff : Video ROM
000c8000-000c97ff : Adapter ROM
000c9800-000cafff : Adapter ROM
000f-000f : System ROM
0010-3ffe : *System RAM*
  0040-005fed40 : Kernel code
  005fed41-006d292f : Kernel data
3fff-3fffefff : ACPI Tables
3000-3fff : ACPI Non-volatile Storage
fc90-fc9f : PCI Bus #01
  fc9b-fc9b : :01:05.1
fc9b-fc9b : tg3
  fc9e-fc9e : :01:05.0
fc9e-fc9e : tg3
fca0-feaf : PCI Bus #03
  fd00-fdff : :03:04.0
  feac-fead : :03:04.0
  feafd000-feafdfff : :03:00.1
feafd000-feafdfff : ohci_hcd
  feafe000-feafefff : :03:00.0
feafe000-feafefff : ohci_hcd
  feaff000-feaf : :03:04.0
febfe000-febfefff : :00:0a.1
febff000-febf : :00:0b.1
ff50-ff5f : PCI Bus #01
ff78- : reserved
**

PCMIIW,

1. From above output it is clear that System RAM is discontinuous. I
calculated addresses in both sections assigned to System RAM (highlighted
in above output) and they are of 1024 MB which is exactly my systems
physical RAM is.

2. But for other IO devices lets say Video RAM,  area is 000a-000b
Now who has assigned these addresses?  Do they remain same forever ? How
kernel comes to know that there is no RAM at 000a-000b but its
Video RAM?


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


Query regarding physically discontiguous memory

2013-12-25 Thread Pritam Bankar
Hi,
I just started reading Memory Managment chapter from book Professional
Linux Kernel Architecture.  At very start of chapter I came across terms
FLATMEM, DISCONTIGMEM and SPARSEMEM. Out of these DISCONTIGMEM and
SPARSEMEM are available to NUMA systens only. Book also says UMA systems
can also choose DISCONTIGMEM option if there address space contains large
holes.  Some googling says DISCONTIGMEM is prefered when we have physical
discontiguous memory.
This is what I don't understand what does it mean by

containing large holes?

physical discontiguous memory?

Is it like when I put 2 RAM chips in a system then memory for them will be
discontiguous?

Would /proc/iomem give me details I wanted?

Per my understanding RAM memory will ALWAYS be contiguous whether its 512
MB or 4 GB.

Please give me graceful example of discontiguous physical memory
That will really help me out.
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Fedora kernel rpmbuild query

2012-12-26 Thread Pritam Bankar
Hi Shraddha,

Please find my comments below,

On Wed, Dec 26, 2012 at 1:35 PM, Shraddha Kamat sh200...@gmail.com wrote:
 Hi List,

 I do the following on Fedora kernel src rpm :
 (1) rpm -ivh kernel-xxx.rpm
 (2) Go to ~/rpmbuild/SPECS dir
 (2) rpmbuild -bp kernel.specs --nodeps

 then in the ~/rpmbuild/BUILD/ dir I get kernel-xxx dir
 where in there are two source dir -
 (1) linux-xxx    A
 (2) vanilla-xxx  B

 Why are these two dir created - How do I use the configuration file
 /boot/config-xxx to build vmlinuz and initrd image ?

Directory B is vanilla kernel source which is standard kernel source.
This is a same source which is available on kernel.org

Directory A is actually for source which has been modified by user. In
this case it will have patches from FEDORA above standard kernel from
kernel.org.

To build vmlinuz and initrd image copy /boot/config-xxx  to Directory
A (linux-xxx) and run sudo make oldconfig then follow normal
compilation steps

 Which dir A or B sould I use for building ?

You should be using directory A




 -- Shraddha


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

Thanks,
Pritam

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


What is modpost ?

2012-12-03 Thread Pritam Bankar
Hi guys,
I want to confirm my understanding regarding modpost and Module.Symvers files.
From my understanding
 a. modpost is used to add versioning information to module.
 b. modpost is also used to create mod.c and
Module.Symvers files per module
 c. then we compile all *.mod.c files and link it to .ko

Is my understanding correct ? For what else purpose modpost is useful
? What is specific data in mod.c file ?

Thanks,
Pritam

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


Re: Fwd: Memory split in 64-bit environment

2012-11-04 Thread Pritam Bankar
Thanks Dmitry and Adam. Great explanation...!

On Fri, Nov 2, 2012 at 9:20 PM, Dmitry Filippov filippov...@gmail.com wrote:
 Every user process in the system has its own virtual address range
 that extends from 0 to TASK_SIZE.
 The area above (from TASK_SIZE to 2^32 or 2^64 ) is reserved
 exclusively for the kernel — and may not be accessed by user
 processes. TASK_SIZE is an architecture-specific constant that divides
 the address space in a given ratio — in IA-32 systems, for instance,
 the address space is divided at 3 GiB so that the virtual address
 space for each process is 3 GiB; 1 GiB is available to the kernel
 because the total size of the virtual address space is 4 GiB. Although
 actual figures differ according to architecture, the general concepts
 do not.
 This division does not depend on how much RAM is available. As a
 result of address space virtualization, each user process thinks it
 has 3 GiB of memory. The userspaces of the individual system processes
 are totally separate from each other. The kernel space at the top end
 of the virtual address space is always the same, regardless of the
 process currently executing.
 Notice that the picture can be more complicated on 64-bit machines
 because these tend to use less than 64 bits to actually manage their
 huge principal virtual address space. Instead of 64 bits, they employ
 a smaller number, for instance, 42 or 47 bits. Because of this, the
 effectively addressable portion of the address space is smaller than
 the principal size. However, it is still larger than the amount of RAM
 that will ever be present in the machine, and is therefore completely
 sufficient. As an advantage, the CPU can save some effort because less
 bits are required to manage the effective address space than are
 required
 to address the complete virtual address space. The virtual address
 space will contain holes that are not addressable in principle in such
 cases.

 hopes this gives high level overview

 thanks,
 Dmitry


 2012/11/2 Adam Lee adam8...@gmail.com:
 On Fri, Nov 02, 2012 at 07:40:11PM +0530, Pritam Bankar wrote:
 On Fri, Nov 2, 2012 at 4:26 PM, Mulyadi Santosa
 mulyadi.sant...@gmail.com wrote:
  Hi :)
 
  On Fri, Nov 2, 2012 at 5:46 PM, Pritam Bankar
  pritambankar1...@gmail.com wrote:
  But I have some questions,
 
  1. How is memory split up on 64-bit architecture
 
  in this URL:
  http://unix.stackexchange.com/questions/32244/user-kernel-split-in-64bit-linux
 
  it says user space get 128 TiB...the rest you can read  there :)
 
  2. Can we override this 3:1 split ?
 
  sure just change PAGE_OFFSET if I remember correctly...however,
  the effects might be harmful, for example for certain virtualization
  since they assume certain address for memory allocation
 
  3. If yes, who can do that user or kernel?
 
  kernel..for sure..

 Thanks Mulyadi. I gone through link but there is no explanation. What
 can be the logic behind kernel space of only 512 MB for 64-bit
 machines. We have 1GB kernel space in 32-bit architecture so 64-bit
 should ideally have much more than that.

 1, that 512MB is kernel text mapping(kernel image), not kernel space.

 2, kernel space under x86_64 is 128TB _now_, same as user space.

 3, _now_, the split is 1:1, because address space is large enough.

 4, change PAGE_OFFSET is not enough, _now_, under x86_64, PAGE_OFFSET is
 0x8800, the beginning of direct mapping of all phys memory,
 but the beginning of kernel space is 0x8000, there is a
 guard hole between them.

 Please check https://en.wikipedia.org/wiki/X86-64, and the reasons I
 underline _now_ are kernel's current design and
 https://en.wikipedia.org/wiki/X86-64#Canonical_form_addresses

 PS, if you can read Chinese(hopeless), check my blog:
 http://adam8157.info/blog/2012/07/linux-x86-64-vm/

 --
 Regards,
 Adam Lee
 http://adam8157.info

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



-- 

Pritam Bankar

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


Re: Missing __versions section on .ko

2012-09-21 Thread Pritam Bankar
Hi Ramesh thanks for great pdf. From whatever I understood after
reading I fired command modinfo on my module and it gave output ,

vermagic:   3.2.0-23-generic-pae SMP mod_unload modversions 686

greping out vermagic. So I believe vermagic is behaving correctly.
What is 686 in output ?
Any other reason for missing __versions section ?

On Wed, Sep 19, 2012 at 6:24 AM, Ramesh.P rames...@gmail.com wrote:
 Hi,

 'Invalid module' is typically thrown when you don't compile your
 module against the kernel you are linking into. I think __versions
 section is added by vermagic.o as part of build process. Please refer
 http://lwn.net/images/pdf/LDD3/ch02.pdf, Version dependency section
 for more details.

 Thanks,
 Ramesh

 On Tue, Sep 18, 2012 at 7:10 AM, Pritam Bankar
 pritambankar1...@gmail.com wrote:
 On Tue, Sep 18, 2012 at 7:27 PM, Pritam Bankar
 pritambankar1...@gmail.com wrote:
 Any idea what causes __versions section to get added in *.ko module. A
 simple hello.ko on ubuntu 12.04 i386 machine gets loaded successfully.
 Other module just doesn't get loaded giving error  Invalid module .
 When I compared both modules with objdump -h I found __versions
 section was missing from second module and that can be the reason its
 not getting loaded. How can I add this section to other .ko ? What
 causes __versions to get added in ko ?


 I have compiled both modules with modpost and Module.symvers.


  Thanks,
  Pritam Bankar

 --

 Pritam Bankar

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



-- 

Pritam Bankar

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


Missing __versions section on .ko

2012-09-18 Thread Pritam Bankar
Any idea what causes __versions section to get added in *.ko module. A
simple hello.ko on ubuntu 12.04 i386 machine gets loaded successfully.
Other module just doesn't get loaded giving error  Invalid module .
When I compared both modules with objdump -h I found __versions
section was missing from second module and that can be the reason its
not getting loaded. How can I add this section to other .ko ? What
causes __versions to get added in ko ?


Thanks,
Pritam Bankar

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


Re: Missing __versions section on .ko

2012-09-18 Thread Pritam Bankar
On Tue, Sep 18, 2012 at 7:27 PM, Pritam Bankar
pritambankar1...@gmail.com wrote:
 Any idea what causes __versions section to get added in *.ko module. A
 simple hello.ko on ubuntu 12.04 i386 machine gets loaded successfully.
 Other module just doesn't get loaded giving error  Invalid module .
 When I compared both modules with objdump -h I found __versions
 section was missing from second module and that can be the reason its
 not getting loaded. How can I add this section to other .ko ? What
 causes __versions to get added in ko ?


I have compiled both modules with modpost and Module.symvers.


 Thanks,
 Pritam Bankar

-- 

Pritam Bankar

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


How to know default gcc flags ?

2012-08-23 Thread Pritam Bankar
How to know default flags used in specific gcc version ? I am looking
for difference between 3.4.3 and 4.1.1 These two have some difference
regarding -nosse option but how can I find this ?

-- 

Pritam Bankar

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


How to know which programming model is used on may Linux machine

2012-07-25 Thread Pritam Bankar
Hi,

AFAIK there are three programming model that can be chosen on 64 bit
environment. These models are LP64, ILP64, LLP64

Question 1)  But how can I know which model is used on my system ?

Question 2) Does long long data type is limited for LLP64 type model ?

(My system is redhat 6.2 64bit)



Thanks

Pritam Bankar

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


What is difference between declaring long and long int

2012-07-24 Thread Pritam Bankar
Hi,

long long x;
long long int y;

Anybody please tell me, is there any difference between declaring
variable with long long and long long int ?
Does both declaration mean same thing ?


Thanks,

Pritam Bankar

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


no-op error in dmesg

2012-06-18 Thread Pritam Bankar

Hi,
I have one structure called foo. Address of object of foo(say objfoo) is 
passed to ioctl call


status = ioctl(fd, arg, objfoo);

But during manipulation I am not getting ioctl error 5 (input/output error).
I am more confused about error in dmesg which is
*foo: no-op *

What does no-op indicate? If it is no-operation, how can we relate this 
to foo structure?


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


Re: Re: Problem with OOM killer killing process even when there is plenty of RAM.

2011-12-09 Thread Pritam Bankar
Hi,
use of
get_zeroed_page(unsigned int flags);  or
get_free_page(unsigned int flags);
might help you.


Thanks,
Pritam

On Thu, Dec 8, 2011 at 9:47 PM, Mulyadi Santosa
mulyadi.sant...@gmail.comwrote:

 Hi...

 On Thu, Dec 8, 2011 at 02:06, mindentropy mindentr...@gmail.com wrote:
  mind to tell us, how do you allocate memory? kmalloc?
  Via kmalloc.

 As Greg said, you probably better use vmalloc for such allocation.
 Vmalloc can deal with non contigous physical pages...

 
  furthermore, could you kindly paste the content of /proc/meminfo right
  before OOM kicks in?
  Its kind of tough to do it as it happens so fast. I will try to write a
 script
  which polls.

 Alright, I just thought it will be better if we understand the overall
 virtual memory situation better.


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




-- 

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


RE: What is RTNL lock?

2011-11-27 Thread Pritam Bankar
Hi,

 

http://lists.openfabrics.org/pipermail/general/2008-July/052458.html

 

This might help you.

 

 

 

 

 

From: kernelnewbies-boun...@kernelnewbies.org
[mailto:kernelnewbies-boun...@kernelnewbies.org] On Behalf Of rohan puri
Sent: 28 November 2011 12:36
To: Vimal; kernelnewbies
Subject: Re: What is RTNL lock?

 

 

On Mon, Nov 28, 2011 at 12:19 PM, Vimal j.vi...@gmail.com wrote:

Hi Rohan

Yes, I understood this part, but I am wondering what is the purpose of
this lock.   I am guessing it's to protect all network related
operations from critical events, for e.g.: protecting a packet
transmit during device removal, protecting routing table entry during
route lookup, etc., but I can't find its precise documentation
anywhere.   Thanks,


On 27 November 2011 22:44, rohan puri rohan.pur...@gmail.com wrote:


 On Sun, Nov 27, 2011 at 10:37 PM, Vimal j.vi...@gmail.com wrote:

 Hi all,

 In the Linux networking code, I see a lot of comments that say Must
 be called with RTNL lock.

 What is this lock?  I tried searching for it but couldn't find any
 explanation on what it is...

 Thanks
 --
 Vimal

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

 Hello Vimal,
 This is a mutex named rtnl_mutex. Refer file net/core/rtnetlink.c
 static DEFINE_MUTEX(rtnl_mutex);

 void rtnl_lock(void)
 {
 mutex_lock(rtnl_mutex);
 }
 EXPORT_SYMBOL(rtnl_lock);
 Where ever you see those comments indicate that this mutex is to be held
 before execution of that code path.
 Regards,
 Rohan




--
Vimal

This lock is used to serialize changes to net_device instances from runtime
events, conf changes

 

Refer book understanding Linux network internals for more details.

 

Regards,

Rohan Puri

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


RE: a few questions regarding acpi and kernel configuration

2011-11-22 Thread Pritam Bankar
Hi, 
To cut down drivers you should configure your .config file in your source.
You will have to recompile kernel.
For pata you have ,

CONFIG_PATA_AMD=y
CONFIG_PATA_OLDPIIX=y
CONFIG_PATA_SCH=y

This can be set to n instead of y to remover support of pata. This can
be done to other modules also.





-Original Message-
From: kernelnewbies-boun...@kernelnewbies.org
[mailto:kernelnewbies-boun...@kernelnewbies.org] On Behalf Of Littlefield,
Tyler
Sent: 19 October 2011 03:43
To: kernelnewbies@kernelnewbies.org
Subject: a few questions regarding acpi and kernel configuration

Hello all:
I have a few questions, I was hoping someone could help me out here.
First, I'll start off by saying that my netbook is a sort of PDA for me. 
I just boot it up and when I'm taking care of stuff for work running around
getting info and that, I can use it to grab the info. I use Linux for this,
but my battery dies kind of quickly. I'm also looking to optomize
performance as much as possible.
So, I sat down and tried to optomize a kernel. Both to save space (since
this is a smaller drive), and to make things a bit quicker, even by a little
bit.
I put the config here:
http://tds-solutions.net/config.tar.bz2
First, I'm curious what else I can yank out of there to make everything
smaller. I'd like to cut down on the drivers and all that, and just include
the driver for my specific harddrive if that's possible, as well as the
wireless card. Can I turn off scsi/pata/ata since I have a sata drive? Is
there other stuff I missed that I could take out?
Finally, my last two questions.
1) Is there a way to access acpi so I can put the computer into standby
quickly? I'm not sure how to pull that off from the cli, but doing it with
code would work.
2) Is there a way for me to detect when the lid of my laptop has been closed
and put it into standby, and/or set an idle timer to put it into standby? If
there are clients out there that can interface with acpi and help with this,
awesome. If not, and I need to code something up, that works too.
Finally, I'm trying to find a way, since I do not use it to turn off the
display. Is this possible?

-- 

Take care,
Ty
Web: http://tds-solutions.net
The Aspen project: a light-weight barebones mud engine
http://code.google.com/p/aspenmud

Sent from my toaster.


___
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: building linux kernel 3.0.4

2011-11-08 Thread Pritam Bankar
 

make defconfig takes default options present in config file at (
arch/x86/configs/) of particular architecture say x86_64_defconfig
http://lxr.linux.no/linux+*/arch/x86/configs/x86_64_defconfig  which is
present in source code. Out of these modules you might not be needing all.
So try using make oldconfig instead of make defconfig.

 

 

From: Pritam Bankar [mailto:pritambankar1...@gmail.com] 
Sent: 08 November 2011 00:35
To: kernelnewbies@kernelnewbies.org
Subject: Re: building linux kernel 3.0.4

 

On 07-11-2011 23:15, ashish anand wrote: 

Hi ,
I am using vmware on windows 7 and try to built kernel version 3.0.4 .
I am following this procedure 

make defconfig
make
make modules 
make modules_install
make install
Every step succeds except make install
Its throwing me following message

sh /home/ashu/linux-3.0.4/linux-3.0.4/arch/x86/boot/install.sh 3.0.4
arch/x86/boot/bzImage \
System.map /boot
ERROR: modinfo: could not find module fuse
ERROR: modinfo: could not find module sunrpc
ERROR: modinfo: could not find module ip6t_REJECT
ERROR: modinfo: could not find module nf_conntrack_ipv6
ERROR: modinfo: could not find module ip6table_filter
ERROR: modinfo: could not find module ip6_tables
ERROR: modinfo: could not find module ipv6
ERROR: modinfo: could not find module uinput
ERROR: modinfo: could not find module snd_ens1371
ERROR: modinfo: could not find module gameport
ERROR: modinfo: could not find module snd_rawmidi
ERROR: modinfo: could not find module snd_ac97_codec
ERROR: modinfo: could not find module ac97_bus
ERROR: modinfo: could not find module snd_seq
ERROR: modinfo: could not find module snd_seq_device
ERROR: modinfo: could not find module snd_pcm
ERROR: modinfo: could not find module ppdev
ERROR: modinfo: could not find module snd_timer
ERROR: modinfo: could not find module parport_pc
ERROR: modinfo: could not find module snd
ERROR: modinfo: could not find module parport
ERROR: modinfo: could not find module microcode
ERROR: modinfo: could not find module soundcore
ERROR: modinfo: could not find module vmware_balloon
ERROR: modinfo: could not find module snd_page_alloc
ERROR: modinfo: could not find module pcnet32
ERROR: modinfo: could not find module mii
ERROR: modinfo: could not find module i2c_piix4
ERROR: modinfo: could not find module i2c_core
ERROR: modinfo: could not find module mptspi
ERROR: modinfo: could not find module mptscsih
ERROR: modinfo: could not find module mptbase
ERROR: modinfo: could not find module scsi_transport_spi

I wonder if my Vmware workstation is creating a problem?

Or 
If I am using make defconfig why are these modules not bulit.
Please help I am stuck.

Thanks and Regards
Ashish Anand
Growth Should Not Kill Innovation





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

make defconfig takes default options present in config file of particular
architecture say x86_64 which is present in source code. Out of these
modules you might not be needing all. So try using make oldconfig. 

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


Re: building linux kernel 3.0.4

2011-11-07 Thread Pritam Bankar

On 07-11-2011 23:15, ashish anand wrote:

Hi ,
I am using vmware on windows 7 and try to built kernel version 3.0.4 .
I am following this procedure

make defconfig
make
make modules
make modules_install
make install
Every step succeds except make install
Its throwing me following message

*sh /home/ashu/linux-3.0.4/linux-3.0.4/arch/x86/boot/install.sh 3.0.4 
arch/x86/boot/bzImage \

System.map /boot
ERROR: modinfo: could not find module fuse
ERROR: modinfo: could not find module sunrpc
ERROR: modinfo: could not find module ip6t_REJECT
ERROR: modinfo: could not find module nf_conntrack_ipv6
ERROR: modinfo: could not find module ip6table_filter
ERROR: modinfo: could not find module ip6_tables
ERROR: modinfo: could not find module ipv6
ERROR: modinfo: could not find module uinput
ERROR: modinfo: could not find module snd_ens1371
ERROR: modinfo: could not find module gameport
ERROR: modinfo: could not find module snd_rawmidi
ERROR: modinfo: could not find module snd_ac97_codec
ERROR: modinfo: could not find module ac97_bus
ERROR: modinfo: could not find module snd_seq
ERROR: modinfo: could not find module snd_seq_device
ERROR: modinfo: could not find module snd_pcm
ERROR: modinfo: could not find module ppdev
ERROR: modinfo: could not find module snd_timer
ERROR: modinfo: could not find module parport_pc
ERROR: modinfo: could not find module snd
ERROR: modinfo: could not find module parport
ERROR: modinfo: could not find module microcode
ERROR: modinfo: could not find module soundcore
ERROR: modinfo: could not find module vmware_balloon
ERROR: modinfo: could not find module snd_page_alloc
ERROR: modinfo: could not find module pcnet32
ERROR: modinfo: could not find module mii
ERROR: modinfo: could not find module i2c_piix4
ERROR: modinfo: could not find module i2c_core
ERROR: modinfo: could not find module mptspi
ERROR: modinfo: could not find module mptscsih
ERROR: modinfo: could not find module mptbase
ERROR: modinfo: could not find module scsi_transport_spi

*I wonder if my Vmware workstation is creating a problem?

Or
If I am using make defconfig why are these modules not bulit.
Please help I am stuck.

Thanks and Regards
Ashish Anand
Growth Should Not Kill Innovation


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
make defconfig takes default options present in config file of 
particular architecture say x86_64 which is present in source code. Out 
of these modules you might not be needing all. So try using make oldconfig.
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: looking for 3.0 source

2011-09-21 Thread Pritam Bankar
I think if have git installed then LXR might do it for you.

On Wed, Sep 21, 2011 at 7:38 AM, Jacky Lam lamshu...@gmail.com wrote:

 Thanks Mirco. But how about if I want to download 3.0.4 source?

 Jacky

 On 9/15/2011 6:08 AM, Mirco Tischler wrote:
  2011/9/14 Littlefield, Tylerty...@tysdomain.com:
  Hello:
  and I'm unsure of where
  to get what I want. I found the 2.6 branch on github, but I'm looking
  for kernel 3.0's source, not 3.4 or whatever we're on now. Is there
  somewhere I can get it?
  https://github.com/torvalds/linux is a clone of the main git repo on
  kernel.org. It contains all versions since 2.6.11, including 3.0 and
  the most recent 3.1-rc6. You can even download the tarballs there.
 
Mirco
 
  ___
  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




-- 

Pritam Bankar
With the recent attacks on kernel.org, it's down
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies