Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp905527imu; Fri, 9 Nov 2018 07:56:59 -0800 (PST) X-Google-Smtp-Source: AJdET5fX0vkkcT7Vr6J9XeKQyqgT4LeNKPUcaZIaVrcJWgPl+gXQUk8hyR1RNWG5DyDSATpd9KvQ X-Received: by 2002:a17:902:7b93:: with SMTP id w19-v6mr9596553pll.80.1541779019432; Fri, 09 Nov 2018 07:56:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541779019; cv=none; d=google.com; s=arc-20160816; b=NrH6VmSuZLfsiyS03OEqZ0vz17CqTOYDQ7+2KmZ3CsMhKUvQ3xMbY492ilTnCf1bzy zysxtpUvzI3zqyso5YEbuA+aVfS/5mrNTF+za0J48XAAIkGYWyGla9iY4PqQWLnDM0Z3 iqL8IkeJ34Go/L9W38L1MfQsoAJWL/na1cchODkKxzT3o+yw7gz1WokhNtmOMFkBo2uy wDqQwgIAhNNkxYBtE8L+AYQxpp6ivaU669lU3P2MDGu/+kytY/07mFR9REQOA9IETNAk 7fwn0axk0aEl6C86JY1hiQctsGBIdH8EUwFX9Y9LNRgOWQpEQWCeygH15eip++DS7U1a z/9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=yPY1Jfc3ks4MubeRL/37hyb2WaUctZXLhcV59/IfI5k=; b=qjnV8EaPXaTnUBnuGMlS4Dh5pn6GmxCzjnsaaGSW5kHjsoHQMbdIVId+jgtp7U2BSX PhpPZMYhMV/qIK+brHFvsXzvIIMCYCfOLMG5KmYxTiZclsz55KvD7fySsgjja6Yi3n4T 4+uP5eV5SvqVeKiWQ73cshmHE5Qzlxf0mbgixIMrESoqftviFS/ZUY/yR+QUJKEqZF8R IwleETGRIUFumK7TNNnId+kOIzTcNg2FMzOyfyrSDMm2BwcldL3J4ylh05wzDeZF6gqe C/XCZ+93Kgtr2QGdn7RwbDO5qjaueTvtcb8z5bmKXrbzVsAvPPCHwpKyH6CGYAbgm0Ne jGRQ== 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 d2-v6si8828102pfa.150.2018.11.09.07.56.10; Fri, 09 Nov 2018 07:56:59 -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 S1728198AbeKJBeQ (ORCPT + 99 others); Fri, 9 Nov 2018 20:34:16 -0500 Received: from mx2.suse.de ([195.135.220.15]:38110 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727784AbeKJBeQ (ORCPT ); Fri, 9 Nov 2018 20:34:16 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id DB309AE6C; Fri, 9 Nov 2018 15:53:06 +0000 (UTC) Date: Fri, 9 Nov 2018 07:52:58 -0800 From: Davidlohr Bueso To: akpm@linux-foundation.org Cc: jbaron@akamai.com, viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Davidlohr Bueso Subject: Re: [PATCH 5/6] fs/epoll: reduce the scope of wq lock in epoll_wait() Message-ID: <20181109155258.jxcr4t2pnz6zqct3@linux-r8p5> References: <20181108051006.18751-1-dave@stgolabs.net> <20181108051006.18751-6-dave@stgolabs.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20181108051006.18751-6-dave@stgolabs.net> User-Agent: NeoMutt/20180323 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sorry, I just realized I forgot these fixlets when sending the v1. diff --git a/fs/eventpoll.c b/fs/eventpoll.c index ec14e5bcdaa9..c37729658c03 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -381,7 +381,7 @@ static void ep_nested_calls_init(struct nested_calls *ncalls) */ static inline int ep_events_available(struct eventpoll *ep) { - return !list_empty(&ep->rdllist) || + return !list_empty_careful(&ep->rdllist) || READ_ONCE(ep->ovflist) != EP_UNACTIVE_PTR; } @@ -1820,8 +1820,9 @@ static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events, res = -EINTR; break; } - - if (ep_events_available(ep)) + + eavail = ep_events_available(ep); + if (eavail) break; if (signal_pending(current)) { res = -EINTR;