public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Manfred Spraul <manfred@colorfullife.com>
To: David Brownell <david-b@pacbell.net>
Cc: Peter Zaitcev <zaitcev@redhat.com>,
	"David S. Miller" <davem@redhat.com>,
	Russell King <rmk@arm.linux.org.uk>,
	linux-usb-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: SLAB vs. pci_alloc_xxx in usb-uhci patch
Date: Wed, 07 Mar 2001 08:05:48 +0100	[thread overview]
Message-ID: <3AA5DDCC.7F9CBA91@colorfullife.com> (raw)
In-Reply-To: <20010306004454.A12846@devserv.devel.redhat.com> <023301c0a693$087591e0$6800000a@brownell.org>

David Brownell wrote:
> 
> There are two problems I see.
> 
> (1) CONFIG_SLAB_DEBUG breaks the documented
> requirement that the slab cache return adequately aligned
> data ...

adequately aligned for the _cpu_, not for some controllers. It's neither
documented that HW_CACHEALIGN aligns to 16 byte boundaries nor that
kmalloc uses HW_CACHEALIGN.

> which the appended patch should probably handle
> nicely (something like it sure did :-) and with less danger
> than the large patch you posted.
>
> (2) The USB host controller drivers all need something
> like a pci_consistent slab cache, which doesn't currently
> exist.  I have something like that in the works, and David
> Miller noted one driver that I may steal from.
>

> - Dave
> 
> --- slab.c-orig Tue Mar  6 15:01:26 2001
> +++ slab.c Tue Mar  6 15:05:58 2001
> @@ -676,12 +676,10 @@
>   }
> 
>  #if DEBUG
> + /* redzoning would break cache alignment requirements */
> + if (flags & SLAB_HWCACHE_ALIGN)
> +  flags &= ~SLAB_RED_ZONE;

The problem is that you've just disabled red zoning for kmalloc. And
kmalloc is the only case where redzoning is important: If a caller uses
kmem_cache_alloc() for a structure then he won't write beyond the end of
the structure.

I think everyone agrees that (2) correct fix.
I see 2 temporary workarounds: either your patch or

+ #ifdef CONFIG_SLAB_DEBUG
+ #error
+ #endif

in uhci.c.

--
	Manfred

  reply	other threads:[~2001-03-07  7:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-06  5:44 SLAB vs. pci_alloc_xxx in usb-uhci patch Peter Zaitcev
2001-03-06 23:13 ` David Brownell
2001-03-07  7:05   ` Manfred Spraul [this message]
2001-03-07 17:43     ` David Brownell
  -- strict thread matches above, loose matches on Subject: below --
2001-03-05 22:08 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  4:53     ` David S. Miller
2001-03-05 19:23 Peter Zaitcev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3AA5DDCC.7F9CBA91@colorfullife.com \
    --to=manfred@colorfullife.com \
    --cc=davem@redhat.com \
    --cc=david-b@pacbell.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=rmk@arm.linux.org.uk \
    --cc=zaitcev@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox