Re: question about alloc_bootmem

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

 



On Fri, Apr 15, 2011 at 1:49 PM, javaweb zhang <javawebzwp@xxxxxxxxx> wrote:
> Hello, everyone. I use alloc_bootmem() in profile.c to allocate a big memory
> at function profile_init(), how I know whether it is success? The following
> is my code:
> // at kernel/profile.c
> ctxsw_A = (struct ctxsw_rec *)alloc_bootmem(sizeof(struct ctxsw_rec)*CTXSW);
> ctxsw_rec is a struct which declared in include/linux/profile.h,  CTXSW =
> 4>>10

4 >> 10 equals to zero. I think that it's your typo error.

If you meet failure on allocating bootmem, kernel will panic.
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@xxxxxxxxxxxxxxxxx
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>

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



[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