diff options
| author | Ingo Molnar <mingo@kernel.org> | 2015-03-23 10:13:36 +0100 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2015-03-23 10:13:36 +0100 |
| commit | eda2360ad18b7cde87728fad85c6735a52c2576e (patch) | |
| tree | 2bc28704b40686c0d3d0fd5aa7d000f9d9dd153f /drivers/usb/core/buffer.c | |
| parent | x86/fpu: Factor out memset(xstate, 0) in fpu_finit() paths (diff) | |
| parent | Linux 4.0-rc5 (diff) | |
| download | linux-eda2360ad18b7cde87728fad85c6735a52c2576e.tar.gz linux-eda2360ad18b7cde87728fad85c6735a52c2576e.zip | |
Merge tag 'v4.0-rc5' into x86/fpu, to prevent conflicts
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/usb/core/buffer.c')
| -rw-r--r-- | drivers/usb/core/buffer.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/drivers/usb/core/buffer.c b/drivers/usb/core/buffer.c index 684ef70dc09d..506b969ea7fd 100644 --- a/drivers/usb/core/buffer.c +++ b/drivers/usb/core/buffer.c @@ -22,17 +22,25 @@ */ /* FIXME tune these based on pool statistics ... */ -static const size_t pool_max[HCD_BUFFER_POOLS] = { - /* platforms without dma-friendly caches might need to - * prevent cacheline sharing... - */ - 32, - 128, - 512, - PAGE_SIZE / 2 - /* bigger --> allocate pages */ +static size_t pool_max[HCD_BUFFER_POOLS] = { + 32, 128, 512, 2048, }; +void __init usb_init_pool_max(void) +{ + /* + * The pool_max values must never be smaller than + * ARCH_KMALLOC_MINALIGN. + */ + if (ARCH_KMALLOC_MINALIGN <= 32) + ; /* Original value is okay */ + else if (ARCH_KMALLOC_MINALIGN <= 64) + pool_max[0] = 64; + else if (ARCH_KMALLOC_MINALIGN <= 128) + pool_max[0] = 0; /* Don't use this pool */ + else + BUILD_BUG(); /* We don't allow this */ +} /* SETUP primitives */ |
