public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: SLAB vs. pci_alloc_xxx in usb-uhci patch
@ 2001-03-05 22:08 Manfred Spraul
  2001-03-05 22:52 ` David Brownell
  0 siblings, 1 reply; 24+ messages in thread
From: Manfred Spraul @ 2001-03-05 22:08 UTC (permalink / raw)
  To: zaitcev; +Cc: linux-usb-devel, linux-kernel, david-b

> And mm/slab.c changes semantics when CONFIG_SLAB_DEBUG
> is set: it ignores SLAB_HWCACHE_ALIGN. That seems more like
> the root cause of the problem to me!
>

HWCACHE_ALIGN does not guarantee a certain byte alignment. And
additionally it's not even guaranteed that kmalloc() uses that
HWCACHE_ALIGN.
Uhci is broken, not my slab code ;-)

> I think that the pci_alloc_consistent patch that Johannes sent
>by for "uhci.c" would be a better approach. Though I'd like
>to see that be more general ... say, making mm/slab.c know
>about such things. Add a simple abstraction, and that should
>be it -- right? :-)

I looked at it, and there are 2 problems that make it virtually
impossible to integrate kmem_cache_alloc() with pci memory alloc without
a major redesign:

* pci_alloc_consistent returns 2 values, kmem_cache_alloc() only one.
This one would be possible to work around.

* the slab allocator heavily relies on the 'struct page' structure, but
it's not guaranteed that it exists for pci_alloced memory.

I'd switch to pci_alloc_consistent with some optimizations to avoid
wasting a complete page for each DMA header. (I haven't seen Johannes
patch, but we discussed the problem 6 weeks ago and that proposal was
the end of the thread)

--

    Manfred


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2001-03-10  3:25 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-03-05 22:08 SLAB vs. pci_alloc_xxx in usb-uhci patch Manfred Spraul
2001-03-05 22:52 ` David Brownell
2001-03-05 23:20   ` Russell King
2001-03-06  2:09     ` Alan Cox
2001-03-06  2:29       ` [linux-usb-devel] " David Brownell
2001-03-06  4:53     ` David S. Miller
2001-03-09 16:18       ` SLAB vs. pci_alloc_xxx in usb-uhci patch [RFC: API] David Brownell
     [not found]         ` <3AA91B2C.BEB85D8C@colorfullife.com>
2001-03-09 18:21           ` David S. Miller
2001-03-09 18:35             ` [linux-usb-devel] " Johannes Erdfelt
2001-03-09 19:42               ` David Brownell
2001-03-09 20:07                 ` David S. Miller
2001-03-09 21:14                   ` David Brownell
2001-03-09 22:34                     ` Pete Zaitcev
2001-03-09 18:35             ` Alan Cox
2001-03-09 18:29           ` David Brownell
2001-03-09 19:14             ` Pete Zaitcev
2001-03-09 19:37               ` David Brownell
2001-03-09 19:04                 ` Gérard Roudier
2001-03-09 22:42                   ` David Brownell
2001-03-09 21:07                     ` Gérard Roudier
2001-03-10  3:11                       ` David Brownell
2001-03-09 20:00               ` David S. Miller
2001-03-09 21:38               ` [linux-usb-devel] " Alan Cox
2001-03-09 20:07             ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox