Re: kmalloc_in_driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Here are some points:
1. If you don't need allocated memory, free it (kfree)
2. There is a limit on memory allocated (I remember some low water mark). If
you specify GFP_KERNEL then memory will be allocated only if available
memory is more than low water mark. If you specify GFP_ATOMIC kernel will
try to allocate memory even if available memory is less than low water mark.
3. Why you get segment fault.. check for memory allocation success or
failure.
4. Why you want to delay timer interrupt. If you want to delay your task,
there are many options available. As far as I know, timer interrupt handler
can only be interrupted if some higher priority interrupt occurs (say
hardware failure).

Regards
Mohanlal

----- Original Message -----
From: "prasanna wakhare" <prasannawakhare@yahoo.com>
To: <kernelnewbies@nl.linux.org>
Sent: Thursday, April 01, 2004 7:59 PM
Subject: kmalloc_in_driver


> Hi all,
> My device driver has fifo which is basically linked
> list,i had written a test program which
> writes 10000 times to device driver,
> the driver everytime executes 'kmalloc'
> for new item whenever device write method invokes
> and stores the data item in list.
>
> my question is that as it is giving segmentation fault
> i have checked every pointer carefully,
> is any memory constraint upto which kernel allocates
> memmory for driver,
> and my test program is mlock in memory but its user
> space program,
> but is there any limit beyond which kernel not
> allocates the memory for driver
>
> and second question is in 2.6   kernels ,
> is it possible to interrupt the timer0 handler when
> its executing normal schedular code,i mean to say
> is is it the case that timer0 is interrupted by some
> other interrupt and thus delaying the execution of
> timer0 interrupt.
> thanks in advance
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Small Business $15K Web Design Giveaway
> http://promotions.yahoo.com/design_giveaway/
>
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive:       http://mail.nl.linux.org/kernelnewbies/
> FAQ:           http://kernelnewbies.org/faq/
>
>


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux