All of lore.kernel.org
 help / color / mirror / Atom feed
* Problem with OOM killer killing process even when there is plenty of RAM.
@ 2011-12-06 18:47 mindentropy
  2011-12-07  5:37 ` Rajat Sharma
  2011-12-07 18:38 ` Mulyadi Santosa
  0 siblings, 2 replies; 11+ messages in thread
From: mindentropy @ 2011-12-06 18:47 UTC (permalink / raw)
  To: kernelnewbies

Hi,

  I am trying to allocate 512MB of RAM in my driver loaded as a module, but 
the OOM killer starts killing all my processes. This machine has around 24GB 
RAM and is a 8 core Xeon. The RAM is allocated in page size chunks (i.e. 
131072 chunks each of size PAGE_SIZE). I am using a 32 bit kernel with PAE 
enabled. The allocation works fine on a machine with 8GB of RAM.

Thanks.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Problem with OOM killer killing process even when there is plenty of RAM.
  2011-12-06 18:47 Problem with OOM killer killing process even when there is plenty of RAM mindentropy
@ 2011-12-07  5:37 ` Rajat Sharma
  2011-12-07 19:13   ` mindentropy
  2011-12-07 18:38 ` Mulyadi Santosa
  1 sibling, 1 reply; 11+ messages in thread
From: Rajat Sharma @ 2011-12-07  5:37 UTC (permalink / raw)
  To: kernelnewbies

driver allocating 512M !!?? what kind of driver it is?

-Rajat

On Wed, Dec 7, 2011 at 12:17 AM, mindentropy <mindentropy@gmail.com> wrote:
> Hi,
>
> ?I am trying to allocate 512MB of RAM in my driver loaded as a module, but
> the OOM killer starts killing all my processes. This machine has around 24GB
> RAM and is a 8 core Xeon. The RAM is allocated in page size chunks (i.e.
> 131072 chunks each of size PAGE_SIZE). I am using a 32 bit kernel with PAE
> enabled. The allocation works fine on a machine with 8GB of RAM.
>
> Thanks.
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Problem with OOM killer killing process even when there is plenty of RAM.
  2011-12-06 18:47 Problem with OOM killer killing process even when there is plenty of RAM mindentropy
  2011-12-07  5:37 ` Rajat Sharma
@ 2011-12-07 18:38 ` Mulyadi Santosa
  2011-12-07 19:06   ` mindentropy
  1 sibling, 1 reply; 11+ messages in thread
From: Mulyadi Santosa @ 2011-12-07 18:38 UTC (permalink / raw)
  To: kernelnewbies

On Wed, Dec 7, 2011 at 01:47, mindentropy <mindentropy@gmail.com> wrote:
> Hi,
>
> ?I am trying to allocate 512MB of RAM in my driver loaded as a module, but
> the OOM killer starts killing all my processes. This machine has around 24GB
> RAM and is a 8 core Xeon. The RAM is allocated in page size chunks (i.e.
> 131072 chunks each of size PAGE_SIZE).

mind to tell us, how do you allocate memory? kmalloc?

furthermore, could you kindly paste the content of /proc/meminfo right
before OOM kicks in?

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Problem with OOM killer killing process even when there is plenty of RAM.
  2011-12-07 18:38 ` Mulyadi Santosa
@ 2011-12-07 19:06   ` mindentropy
  2011-12-07 19:35     ` Greg KH
  2011-12-08 16:17     ` Mulyadi Santosa
  0 siblings, 2 replies; 11+ messages in thread
From: mindentropy @ 2011-12-07 19:06 UTC (permalink / raw)
  To: kernelnewbies

On Thursday 08 Dec 2011 1:38:19 AM Mulyadi Santosa wrote:
> On Wed, Dec 7, 2011 at 01:47, mindentropy <mindentropy@gmail.com> wrote:
> > Hi,
> > 
> >  I am trying to allocate 512MB of RAM in my driver loaded as a module,
> > but the OOM killer starts killing all my processes. This machine has
> > around 24GB RAM and is a 8 core Xeon. The RAM is allocated in page size
> > chunks (i.e. 131072 chunks each of size PAGE_SIZE).
> 
> mind to tell us, how do you allocate memory? kmalloc?
Via kmalloc. 

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Problem with OOM killer killing process even when there is plenty of RAM.
  2011-12-07  5:37 ` Rajat Sharma
@ 2011-12-07 19:13   ` mindentropy
  0 siblings, 0 replies; 11+ messages in thread
From: mindentropy @ 2011-12-07 19:13 UTC (permalink / raw)
  To: kernelnewbies

On Wednesday 07 Dec 2011 11:07:00 AM Rajat Sharma wrote:
> driver allocating 512M !!?? what kind of driver it is?
> 
> -Rajat
> 
For a high speed frame grabber. The data would be in bursts the queue is meant 
to smoothen the pressure. I am not sure why its surprising since I am using 
only 2% of the memory (Only 63MB is being used overall by the system).

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Problem with OOM killer killing process even when there is plenty of RAM.
  2011-12-07 19:06   ` mindentropy
@ 2011-12-07 19:35     ` Greg KH
  2011-12-07 19:56       ` mindentropy
  2011-12-08 16:17     ` Mulyadi Santosa
  1 sibling, 1 reply; 11+ messages in thread
From: Greg KH @ 2011-12-07 19:35 UTC (permalink / raw)
  To: kernelnewbies

On Thu, Dec 08, 2011 at 12:36:43AM +0530, mindentropy wrote:
> On Thursday 08 Dec 2011 1:38:19 AM Mulyadi Santosa wrote:
> > On Wed, Dec 7, 2011 at 01:47, mindentropy <mindentropy@gmail.com> wrote:
> > > Hi,
> > > 
> > >  I am trying to allocate 512MB of RAM in my driver loaded as a module,
> > > but the OOM killer starts killing all my processes. This machine has
> > > around 24GB RAM and is a 8 core Xeon. The RAM is allocated in page size
> > > chunks (i.e. 131072 chunks each of size PAGE_SIZE).
> > 
> > mind to tell us, how do you allocate memory? kmalloc?
> Via kmalloc. 

Please use the functions written to give you large memory chunks.  As
you are using a video-for-linux device, why not use the apis that this
framework provides you for this type of thing?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Problem with OOM killer killing process even when there is plenty of RAM.
  2011-12-07 19:35     ` Greg KH
@ 2011-12-07 19:56       ` mindentropy
  2011-12-07 20:11         ` Greg KH
  0 siblings, 1 reply; 11+ messages in thread
From: mindentropy @ 2011-12-07 19:56 UTC (permalink / raw)
  To: kernelnewbies

On Wednesday 07 Dec 2011 11:35:36 AM Greg KH wrote:
> On Thu, Dec 08, 2011 at 12:36:43AM +0530, mindentropy wrote:
> > On Thursday 08 Dec 2011 1:38:19 AM Mulyadi Santosa wrote:
> > > On Wed, Dec 7, 2011 at 01:47, mindentropy <mindentropy@gmail.com> wrote:
> > > > Hi,
> > > > 
> > > >  I am trying to allocate 512MB of RAM in my driver loaded as a
> > > >  module,> > > 
> > > > but the OOM killer starts killing all my processes. This machine
> > > > has
> > > > around 24GB RAM and is a 8 core Xeon. The RAM is allocated in
> > > > page size chunks (i.e. 131072 chunks each of size PAGE_SIZE).
> > > 
> > > mind to tell us, how do you allocate memory? kmalloc?
> > 
> > Via kmalloc.
> 
> Please use the functions written to give you large memory chunks.  As
> you are using a video-for-linux device, why not use the apis that this
> framework provides you for this type of thing?
> 

Yes V4L would be done next. There are some things being tried out, this being 
a custom FPGA hence some controls being experimented.

As for the allocating in PAGE_SIZE chunks why am I running out of memory? 
Can't it steal smaller chunks from the larger chunks? Just curious about the 
reason.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Problem with OOM killer killing process even when there is plenty of RAM.
  2011-12-07 19:56       ` mindentropy
@ 2011-12-07 20:11         ` Greg KH
  2011-12-08  6:50           ` Rajat Sharma
  0 siblings, 1 reply; 11+ messages in thread
From: Greg KH @ 2011-12-07 20:11 UTC (permalink / raw)
  To: kernelnewbies

On Thu, Dec 08, 2011 at 01:26:42AM +0530, mindentropy wrote:
> On Wednesday 07 Dec 2011 11:35:36 AM Greg KH wrote:
> > On Thu, Dec 08, 2011 at 12:36:43AM +0530, mindentropy wrote:
> > > On Thursday 08 Dec 2011 1:38:19 AM Mulyadi Santosa wrote:
> > > > On Wed, Dec 7, 2011 at 01:47, mindentropy <mindentropy@gmail.com> wrote:
> > > > > Hi,
> > > > > 
> > > > >  I am trying to allocate 512MB of RAM in my driver loaded as a
> > > > >  module,> > > 
> > > > > but the OOM killer starts killing all my processes. This machine
> > > > > has
> > > > > around 24GB RAM and is a 8 core Xeon. The RAM is allocated in
> > > > > page size chunks (i.e. 131072 chunks each of size PAGE_SIZE).
> > > > 
> > > > mind to tell us, how do you allocate memory? kmalloc?
> > > 
> > > Via kmalloc.
> > 
> > Please use the functions written to give you large memory chunks.  As
> > you are using a video-for-linux device, why not use the apis that this
> > framework provides you for this type of thing?
> > 
> 
> Yes V4L would be done next. There are some things being tried out, this being 
> a custom FPGA hence some controls being experimented.
> 
> As for the allocating in PAGE_SIZE chunks why am I running out of memory? 

The kernel doesn't like allocating such large sizes all at once.

> Can't it steal smaller chunks from the larger chunks? Just curious about the 
> reason.

Use vmalloc if you need/want larger chunks, kmalloc is not for that at
all.

greg k-h

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Problem with OOM killer killing process even when there is plenty of RAM.
  2011-12-07 20:11         ` Greg KH
@ 2011-12-08  6:50           ` Rajat Sharma
  0 siblings, 0 replies; 11+ messages in thread
From: Rajat Sharma @ 2011-12-08  6:50 UTC (permalink / raw)
  To: kernelnewbies

On Thu, Dec 8, 2011 at 1:41 AM, Greg KH <greg@kroah.com> wrote:
> On Thu, Dec 08, 2011 at 01:26:42AM +0530, mindentropy wrote:
>> On Wednesday 07 Dec 2011 11:35:36 AM Greg KH wrote:
>> > On Thu, Dec 08, 2011 at 12:36:43AM +0530, mindentropy wrote:
>> > > On Thursday 08 Dec 2011 1:38:19 AM Mulyadi Santosa wrote:
>> > > > On Wed, Dec 7, 2011 at 01:47, mindentropy <mindentropy@gmail.com> wrote:
>> > > > > Hi,
>> > > > >
>> > > > > ?I am trying to allocate 512MB of RAM in my driver loaded as a
>> > > > > ?module,> > >
>> > > > > but the OOM killer starts killing all my processes. This machine
>> > > > > has
>> > > > > around 24GB RAM and is a 8 core Xeon. The RAM is allocated in
>> > > > > page size chunks (i.e. 131072 chunks each of size PAGE_SIZE).
>> > > >
>> > > > mind to tell us, how do you allocate memory? kmalloc?
>> > >
>> > > Via kmalloc.
>> >
>> > Please use the functions written to give you large memory chunks. ?As
>> > you are using a video-for-linux device, why not use the apis that this
>> > framework provides you for this type of thing?
>> >
>>
>> Yes V4L would be done next. There are some things being tried out, this being
>> a custom FPGA hence some controls being experimented.
>>
>> As for the allocating in PAGE_SIZE chunks why am I running out of memory?
>
> The kernel doesn't like allocating such large sizes all at once.
>
>> Can't it steal smaller chunks from the larger chunks? Just curious about the
>> reason.
>
> Use vmalloc if you need/want larger chunks, kmalloc is not for that at
> all.
>
> greg k-h
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Probably if it is some custom hardware, and you can afford to allocate
memory at boot time, then reserve it exclusively for your use only.

-Rajat

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Problem with OOM killer killing process even when there is plenty of RAM.
  2011-12-07 19:06   ` mindentropy
  2011-12-07 19:35     ` Greg KH
@ 2011-12-08 16:17     ` Mulyadi Santosa
  2011-12-09 11:45       ` Pritam Bankar
  1 sibling, 1 reply; 11+ messages in thread
From: Mulyadi Santosa @ 2011-12-08 16:17 UTC (permalink / raw)
  To: kernelnewbies

Hi...

On Thu, Dec 8, 2011 at 02:06, mindentropy <mindentropy@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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Problem with OOM killer killing process even when there is plenty of RAM.
  2011-12-08 16:17     ` Mulyadi Santosa
@ 2011-12-09 11:45       ` Pritam Bankar
  0 siblings, 0 replies; 11+ messages in thread
From: Pritam Bankar @ 2011-12-09 11:45 UTC (permalink / raw)
  To: kernelnewbies

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.santosa@gmail.com>wrote:

> Hi...
>
> On Thu, Dec 8, 2011 at 02:06, mindentropy <mindentropy@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 at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



-- 

Pritam Bankar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20111209/1ddbc396/attachment.html 

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-12-09 11:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-06 18:47 Problem with OOM killer killing process even when there is plenty of RAM mindentropy
2011-12-07  5:37 ` Rajat Sharma
2011-12-07 19:13   ` mindentropy
2011-12-07 18:38 ` Mulyadi Santosa
2011-12-07 19:06   ` mindentropy
2011-12-07 19:35     ` Greg KH
2011-12-07 19:56       ` mindentropy
2011-12-07 20:11         ` Greg KH
2011-12-08  6:50           ` Rajat Sharma
2011-12-08 16:17     ` Mulyadi Santosa
2011-12-09 11:45       ` Pritam Bankar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.