Messages in this thread | | | Date | Fri, 22 Sep 2006 15:55:10 -0700 | From | "Om Narasimhan" <> | Subject | Re: [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/
| |