Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1716488imu; Wed, 12 Dec 2018 03:07:23 -0800 (PST) X-Google-Smtp-Source: AFSGD/WMaeE7J793AUSxhygjlsM6OrRRilTIRnkxvfgiomd4kwvHOMXHLCvXGLDZMa4I2amCFRfP X-Received: by 2002:a62:1f53:: with SMTP id f80mr19743574pff.92.1544612842978; Wed, 12 Dec 2018 03:07:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544612842; cv=none; d=google.com; s=arc-20160816; b=sZwZ6033N8wBSU82z0+VSH4h/H6++fH+57u46h27nXXmNE/0WyxrxQq1Rei3iQxpH1 UrZFQ1WAa0GmGZTJSwV6K17oCgTwO+EA0lhaDILFUl+1LwnVHzJDqiuDggwJmSLOGmoO /TesYHLuoLb9wGiebzmYL1KBz7l5/6ejl7SfiMkA7hVngyLInPDshv6YHrPmJ6xP6Nyj cJl0zizV2cMNkJxoSYMBaXdvzZAIF+UDTKUe98VKvcKXDDH6FQPOqBs9duGoMGFvvPAF EZh+PsMhLgf9P1TjhSE4yWv9pAwfqz2xh1HVNnDfcUNLpXdWYOp2e9H1+acWIgu0oVOv QA+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from; bh=1HjEV+SdpRwa0y83H2kGnPG26PkRWvsWqDff/XVEG0s=; b=p9agEG94bNl69qwxgRLMUJNsnKw6rHTRa8zVe65Go+2wVYx07TMmwCLf555CFjzMqZ ZoD3qau92nlALDxVLUmoT89hYlfmibzSmfh50//jHwB4Yh7RQaJJTBMi5Vg4WnS8+Ypw /Go0FSPYb4/Lx+jP3oQ0245T9Pbko0IIKOuTgTFIFbV+qpSnxjGrUJFxV5zuVhlbRCcz JndMVkxIwnkazWTuGwJ7YvRFBQJTHdZhi4owDT3CAsLIMTLtrjYfB9y9y0WsSht6o0sm WGj/H+uZbPWcIILfu4A5AhP0oJNWfaEDFtNf527wQcw7JfFelnSxoZ8oY4HYISuJj7TH e//Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t12si14380796plq.190.2018.12.12.03.07.08; Wed, 12 Dec 2018 03:07:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727304AbeLLLEh (ORCPT + 99 others); Wed, 12 Dec 2018 06:04:37 -0500 Received: from mx2.suse.de ([195.135.220.15]:46016 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727061AbeLLLEd (ORCPT ); Wed, 12 Dec 2018 06:04:33 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 66335AEFC; Wed, 12 Dec 2018 11:04:31 +0000 (UTC) From: Roman Penyaev Cc: Roman Penyaev , Davidlohr Bueso , Jason Baron , Al Viro , Andrew Morton , Linus Torvalds , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] epoll: loosen irq safety in ep_poll_callback() Date: Wed, 12 Dec 2018 12:03:56 +0100 Message-Id: <20181212110357.25656-3-rpenyaev@suse.de> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181212110357.25656-1-rpenyaev@suse.de> References: <20181212110357.25656-1-rpenyaev@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Callers of the ep_poll_callback() (all set of wake_up_*poll()) disable interrupts, so no need to save/restore irq flags. Signed-off-by: Roman Penyaev Cc: Davidlohr Bueso Cc: Jason Baron Cc: Al Viro Cc: Andrew Morton Cc: Linus Torvalds Cc: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- fs/eventpoll.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 3627c2e07149..ea0025e77519 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -1124,13 +1124,15 @@ struct file *get_epoll_tfile_raw_ptr(struct file *file, int tfd, static int ep_poll_callback(wait_queue_entry_t *wait, unsigned mode, int sync, void *key) { int pwake = 0; - unsigned long flags; struct epitem *epi = ep_item_from_wait(wait); struct eventpoll *ep = epi->ep; __poll_t pollflags = key_to_poll(key); int ewake = 0; - spin_lock_irqsave(&ep->wq.lock, flags); + /* Interrupts are disabled by the wake_up_*poll() callers */ + lockdep_assert_irqs_disabled(); + + spin_lock(&ep->wq.lock); ep_set_busy_poll_napi_id(epi); @@ -1207,7 +1209,7 @@ static int ep_poll_callback(wait_queue_entry_t *wait, unsigned mode, int sync, v pwake++; out_unlock: - spin_unlock_irqrestore(&ep->wq.lock, flags); + spin_unlock(&ep->wq.lock); /* We have to call this outside the lock */ if (pwake) -- 2.19.1