Re: malloc memory to be 32 byte aligned in kernel

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

 



On Tue, 28 Jan 2014 17:00:13 -0800, m silverstri said:
> Thanks. How big should be my  slab cache and how to allocate from that?

kmem_cache_alloc() and kmem_cache_free() are your friends.

> And to declare a struct ' __attribute__(aligned(32))'', does that mean
> I do that for every file in my struct?

I'm guessing you mean "for every field in my struct".  And the answer is
no, unless you actually need the alignment/padding for every field. You
declare the struct wrapping all the stuff you need and give that the aligned().

Attachment: pgp0iv80vqRke.pgp
Description: PGP signature

_______________________________________________
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