Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp194882ybz; Wed, 15 Apr 2020 07:05:17 -0700 (PDT) X-Google-Smtp-Source: APiQypLcILd/VfiwgII85uEwKXVWrcI0Sy0XzNrnzx/E4OV2trSh/sjeAQCJM493KPnqFhu03VuU X-Received: by 2002:a1c:6455:: with SMTP id y82mr5313065wmb.128.1586959517624; Wed, 15 Apr 2020 07:05:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586959517; cv=none; d=google.com; s=arc-20160816; b=BW/xXsvEVJzcZOJ6Tubku53XaH3q3NT8leMqKg+FGeDchU2LGQj7y6oickcjSpYv9u jQMXfKwldEmqNv0E7oPgnMTkKCp+lipCVSH/2u2CYS37FsyfXY5Cu/uVwJ/m1SQylL1S E09Fj8kTN/v7fkypNfq32UF0NQ9WzOumPeanRCeod1cfcuT01gnRqDk1IPQCb2/Af4MP F5AoYFKOn38wQ0JmIrZa/HvchRmXqA1GFjvIZ9PNfDKQn60o94SEhZnlV6/GRyGvteGH PbsWzZ/zwKJxcHUG+KlD4CxqbA4B0ufwNjPY6LDOcimh/MKml5p/jQ5YLsoSOC/CAIqj PeTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=5oGa0W5Fsbmz/lO6hF1+2jTv7urB98e3nfs+3wn0Vig=; b=fqNfntfLAmbRtm74c6aYQFHgbs8XonAy+57oMNnQbC0AnJ5KmnYoUWkA42iZ/Xb3VQ AtfDcOwQO6483L5E4L8lID7TwPjW6NRpMuwl1bnNSy6y6XUUbkq9xGVkU7/LlOZ6dPOE 37tVcDzCsZQ4CUtDFWLPCij32iP/cxTmVK/dNeecZChKwKTFrX1h3o/PGoSvZN78bpaN r8WKpfU3iQwkRoRJomPu/I0FhkJK+Ws7CNbxQQSWuGZD3LSf41bzuipu6K8RaQwdnOHH O3/qOruN6Bz54mVIQ2T0N5PFvNx0Dvxop28IIZpI1ktPu/o3PVTtT9B/IBeGF3j6m3+y Zc8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UYvSSw53; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l3si5903166edr.46.2020.04.15.07.04.45; Wed, 15 Apr 2020 07:05:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UYvSSw53; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2634047AbgDNVnB (ORCPT + 99 others); Tue, 14 Apr 2020 17:43:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2633994AbgDNVlE (ORCPT ); Tue, 14 Apr 2020 17:41:04 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2D09C061A10; Tue, 14 Apr 2020 14:41:03 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id t14so3137481wrw.12; Tue, 14 Apr 2020 14:41:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=5oGa0W5Fsbmz/lO6hF1+2jTv7urB98e3nfs+3wn0Vig=; b=UYvSSw53Fe7TxkT0l/l25seIAe1fEVK8A4lNJp7QByB4h9zfjJgXKCXLfEdMz3urVO K/C1fKrtWd+dVTxDp/rcN+rMTLnhBMGVt1QqQzxy55Gaf8E0ad0WR3KWNlvr1rrIiJ0n yXdiVTt+vWoxcEoTkLzbAiVISDlspLik5RFp2B4uHF9Hsv4PTAI9wmjzLERFVCj3mK1R ECymRv4ejPeHXK6sFgsjCoDTpEBihBxM45GAjaMe0zijNBs/7BkKJ01svc5wKK/XYznr 7D72XHKv3/cW7yQx+mW2BGv5KK8eRMbigCDKKJLZ+rKK/V63VHV5kNLnuLc/rm/hlggT jHqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5oGa0W5Fsbmz/lO6hF1+2jTv7urB98e3nfs+3wn0Vig=; b=tb2vzZ+eewt+Or3Ir6tlr+yiZNY4laaOjmj2eGZZ82sBNreT4mvbvRMAUGu5ccQzv3 x4dJAex8Ue+x2N5jT2LdJ/N3E2pJ9J6LbI8nN2vp0l1UtZKIDnV73bSFjJ7QKD7bSQTv pc0H5na90f0sM2x0Jgy/nWGiGDb+VHWu23EeQBA/ZJXIjjuTS31zpnuxoN4Jjl5SE6US sljnJq4+zQDSuYIAPSv4E0DSAEYO+J22IcDZ5tB1m1yl35RwXe1GND8jo2n7JaT9N/xl e9s3YzX464aPaTs22PabOsE03oxqujqtL+v0NaOh9FjdcN1thoGH6L7EbjGwsqnzcsww GTkg== X-Gm-Message-State: AGi0PuYDPVroeY9Tejoa85XorPzY53fRPtOq9a5X7GRMuBFhP4U5VQQL JIZAVGXy69+8A03GvV1PXiN4auyG X-Received: by 2002:a5d:4645:: with SMTP id j5mr8777977wrs.282.1586900462404; Tue, 14 Apr 2020 14:41:02 -0700 (PDT) Received: from localhost.localdomain ([109.126.129.227]) by smtp.gmail.com with ESMTPSA id l185sm20320540wml.44.2020.04.14.14.41.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Apr 2020 14:41:02 -0700 (PDT) From: Pavel Begunkov To: Jens Axboe , io-uring@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] io_uring: kill already cached timeout.seq_offset Date: Wed, 15 Apr 2020 00:39:49 +0300 Message-Id: <1a62f615d10d81ff2b99eb1bcb087a620c96ab69.1586899625.git.asml.silence@gmail.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org req->timeout.count and req->io->timeout.seq_offset store the same value, which is sqe->off. Kill the second one Signed-off-by: Pavel Begunkov --- fs/io_uring.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index fcc320d67606..e69cb70c11d4 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -357,7 +357,6 @@ struct io_timeout_data { struct hrtimer timer; struct timespec64 ts; enum hrtimer_mode mode; - u32 seq_offset; }; struct io_accept { @@ -385,7 +384,7 @@ struct io_timeout { struct file *file; u64 addr; int flags; - unsigned count; + u32 count; }; struct io_rw { @@ -4668,11 +4667,11 @@ static int io_timeout_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe, static int io_timeout(struct io_kiocb *req) { - unsigned count; struct io_ring_ctx *ctx = req->ctx; struct io_timeout_data *data; struct list_head *entry; unsigned span = 0; + u32 count = req->timeout.count; u32 seq = req->sequence; data = &req->io->timeout; @@ -4682,7 +4681,6 @@ static int io_timeout(struct io_kiocb *req) * timeout event to be satisfied. If it isn't set, then this is * a pure timeout request, sequence isn't used. */ - count = req->timeout.count; if (!count) { req->flags |= REQ_F_TIMEOUT_NOSEQ; spin_lock_irq(&ctx->completion_lock); @@ -4691,7 +4689,6 @@ static int io_timeout(struct io_kiocb *req) } req->sequence = seq + count; - data->seq_offset = count; /* * Insertion sort, ensuring the first entry in the list is always @@ -4702,7 +4699,7 @@ static int io_timeout(struct io_kiocb *req) struct io_kiocb *nxt = list_entry(entry, struct io_kiocb, list); unsigned nxt_seq; long long tmp, tmp_nxt; - u32 nxt_offset = nxt->io->timeout.seq_offset; + u32 nxt_offset = nxt->timeout.count; if (nxt->flags & REQ_F_TIMEOUT_NOSEQ) continue; -- 2.24.0