On 12/4/18 7:49 AM, Christoph Hellwig wrote:
>> -req = kmem_cache_alloc(kiocb_cachep, GFP_KERNEL|__GFP_ZERO);
>> -if (unlikely(!req))
>> -return NULL;
>> +req = kmem_cache_alloc(kiocb_cachep, GFP_KERNEL);
>> +if (req) {
>> +percpu_ref_get(>reqs);
>> +
> - req = kmem_cache_alloc(kiocb_cachep, GFP_KERNEL|__GFP_ZERO);
> - if (unlikely(!req))
> - return NULL;
> + req = kmem_cache_alloc(kiocb_cachep, GFP_KERNEL);
> + if (req) {
> + percpu_ref_get(>reqs);
> + req->ki_ctx = ctx;
> +
It's 192 bytes, fairly substantial. Most items don't need to be cleared,
especially not upfront. Clear the ones we do need to clear, and leave
the other ones for setup when the iocb is prepared and submitted.
Signed-off-by: Jens Axboe
---
fs/aio.c | 19 ---
1 file changed, 12