From patchwork Tue Dec 11 00:15:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 10722813 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 63B3514E2 for ; Tue, 11 Dec 2018 00:16:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53FC32A480 for ; Tue, 11 Dec 2018 00:16:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 488392A485; Tue, 11 Dec 2018 00:16:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA6992A480 for ; Tue, 11 Dec 2018 00:16:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729188AbeLKAQO (ORCPT ); Mon, 10 Dec 2018 19:16:14 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:38984 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729164AbeLKAQN (ORCPT ); Mon, 10 Dec 2018 19:16:13 -0500 Received: by mail-pl1-f194.google.com with SMTP id 101so6030689pld.6 for ; Mon, 10 Dec 2018 16:16:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=j8zbGImEaiI6fzdEzobInCNQIlTJ46kLaRSNEoXmu1s=; b=mobL/sgXqqCnQNBG8A1SuXTWeUbV+ofMZxhvx1FLlC6QcW+sMYvEsGzjJeNt37/GVf bu3aUbbIo8k77wc2T6b2vYP1CXwmc/ZIBdjYtMnUDxlhrJPiaRP9EQzoy0HRWK49PRCX vurIwT/wnro9DlFiegGdET84bJdCCK5mLT0XHfKmOmFGqNRsW8De75iV8C47EJYlFQQl CmztOL59uQd3rXGQMt+7RxwD04pXTWE2VdIR1ZymjNjdc8w6A4eIn7MAlWPxbLB1+z44 XtQT60+rUYNjzr5ihIeRfmEmT52cvW/a6Oj7iSN+bCN75AS1ufHGhYEoY1+xeOUDVhrN 0s8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=j8zbGImEaiI6fzdEzobInCNQIlTJ46kLaRSNEoXmu1s=; b=ke4QrRn8n6qb82eLgkzs1uQxqQ37Wux8Y61epHSUwmuztFESsq1t62khUNlb4oW3ow ILp9OBRFQBZZBQe2mqJYSaHTK9QDozwH8U1hcD4G0+u+aGadqHBZsT7pLRx+ziTLmN3M X4du2on8ZXDBgKNtsYKd1TI0VHTBZgvfzx4O3t9fd9cQI/YO8WGo2bO14lR4HaF1icUQ kD8E9wXYoIhUfaTeZmm68VjDUmgix3l3qTb26WDewdssDWGtmD09giIQV1T5zHve9f4b yWHg/2rFCTD0meGtSEQEEmj9E5tBKdBu4+8P4Zc2Gz65QFsAxLzG6U3BTtJsUlJAPWB2 E5fg== X-Gm-Message-State: AA+aEWaRHuSY410eG0SdZM5v9YTq3X/7w5NS8AcPv9+lNnrTbYBYZiZP 5eNjrX3k6Q72Fq/MGAkNu3W1mg== X-Google-Smtp-Source: AFSGD/Uhx09gfBxAVsQBf/gfo9USeD/Xs5h/cTDX9ehOEsncld6HdPpMRU54NvEOb4MRhJ46Meq4OA== X-Received: by 2002:a17:902:a83:: with SMTP id 3mr13132906plp.276.1544487373090; Mon, 10 Dec 2018 16:16:13 -0800 (PST) Received: from x1.localdomain (66.29.188.166.static.utbb.net. [66.29.188.166]) by smtp.gmail.com with ESMTPSA id u8sm16872856pfl.16.2018.12.10.16.16.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Dec 2018 16:16:12 -0800 (PST) From: Jens Axboe To: linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-aio@kvack.org Cc: hch@lst.de, jmoyer@redhat.com, clm@fb.com, Jens Axboe Subject: [PATCH 08/27] aio: don't zero entire aio_kiocb aio_get_req() Date: Mon, 10 Dec 2018 17:15:30 -0700 Message-Id: <20181211001549.30085-9-axboe@kernel.dk> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181211001549.30085-1-axboe@kernel.dk> References: <20181211001549.30085-1-axboe@kernel.dk> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe --- fs/aio.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fs/aio.c b/fs/aio.c index eaceb40e6cf5..522c04864d82 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -1009,14 +1009,15 @@ static inline struct aio_kiocb *aio_get_req(struct kioctx *ctx) { struct aio_kiocb *req; - req = kmem_cache_alloc(kiocb_cachep, GFP_KERNEL|__GFP_ZERO); + req = kmem_cache_alloc(kiocb_cachep, GFP_KERNEL); if (unlikely(!req)) return NULL; percpu_ref_get(&ctx->reqs); + req->ki_ctx = ctx; INIT_LIST_HEAD(&req->ki_list); refcount_set(&req->ki_refcnt, 0); - req->ki_ctx = ctx; + req->ki_eventfd = NULL; return req; } @@ -1730,6 +1731,10 @@ static ssize_t aio_poll(struct aio_kiocb *aiocb, struct iocb *iocb) if (unlikely(!req->file)) return -EBADF; + req->head = NULL; + req->woken = false; + req->cancelled = false; + apt.pt._qproc = aio_poll_queue_proc; apt.pt._key = req->events; apt.iocb = aiocb;