lkml.org 
[lkml]   [2006]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [KJ] kmalloc to kzalloc patches for drivers/block [sane version]
> I think the we should follow a rule like this: when allocating several
> separate objects of the same type at the same time (like 10 "card"
> structures) kcalloc should be used. When allocating one object (even
> consisting of "several ints") kmalloc/kzalloc should be used. As far
> as I can see the code just tries to allocate longish bitmap and so
> kzalloc is better.
>
> Better yet, why don't you DECLARE_BITMAP(cmd_pool_bits) and embed it
> right into struct ctrl_info instead of dynamically allocating it?
hba is decalred as
static ctlr_info_t *hba[MAX_CTLR]
So if I change the cmd_pool_bits to embed the DECLARE_BITMAP
statement, while compiling this file as a module, is there not a
chance of cmd_pool_bits cross a page boundary and allocated in two non
contiguous (physical) pages? Would it cause a problem with
__find_fist_zero_bit() and friends?
Regards,
Om.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-09-23 00:57    [W:1.379 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site