From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC241C4361B for ; Fri, 18 Dec 2020 22:01:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7530A23BA7 for ; Fri, 18 Dec 2020 22:01:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7530A23BA7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0FA2A6B005C; Fri, 18 Dec 2020 17:01:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0A5556B0074; Fri, 18 Dec 2020 17:01:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EB0D06B0075; Fri, 18 Dec 2020 17:01:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0009.hostedemail.com [216.40.44.9]) by kanga.kvack.org (Postfix) with ESMTP id D7BF76B005C for ; Fri, 18 Dec 2020 17:01:56 -0500 (EST) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 94F272DFC for ; Fri, 18 Dec 2020 22:01:56 +0000 (UTC) X-FDA: 77607776232.20.loaf15_1511c4c27440 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id 6816F180C0F79 for ; Fri, 18 Dec 2020 22:01:56 +0000 (UTC) X-HE-Tag: loaf15_1511c4c27440 X-Filterd-Recvd-Size: 2390 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Fri, 18 Dec 2020 22:01:55 +0000 (UTC) Date: Fri, 18 Dec 2020 14:01:54 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1608328915; bh=j3qlxyfozMkL4HzesaEpJH5bOTQCSc6uzzDERBusoBY=; h=From:To:Subject:In-Reply-To:From; b=F4rQzoNIllnhzLNmG17fKoSp1cM2BkvZrXmGEPIzvVRpZWRWZdhGgeRAgCB4tSbP4 PTumCTrJJAllmJCi2Zlf9PMhjY1yxyinzi4z7ZFI29utzYo4sqsQv1fj0SIbTklz58 i0fQv7wB+qoKin79WvUARzzUB8Hh5yIMfcBoZbP0= From: Andrew Morton To: akpm@linux-foundation.org, edumazet@google.com, guantaol@google.com, khazhy@google.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, soheil@google.com, torvalds@linux-foundation.org, willemb@google.com Subject: [patch 09/78] epoll: move eavail next to the list_empty_careful check Message-ID: <20201218220154.x7I97m8oa%akpm@linux-foundation.org> In-Reply-To: <20201218140046.497484741326828e5b5d46ec@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Soheil Hassas Yeganeh Subject: epoll: move eavail next to the list_empty_careful check This is a no-op change and simply to make the code more coherent. Link: https://lkml.kernel.org/r/20201106231635.3528496-5-soheil.kdev@gmail.com Signed-off-by: Soheil Hassas Yeganeh Suggested-by: Linus Torvalds Reviewed-by: Eric Dumazet Reviewed-by: Willem de Bruijn Reviewed-by: Khazhismel Kumykov Cc: Guantao Liu Signed-off-by: Andrew Morton --- fs/eventpoll.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/fs/eventpoll.c~epoll-move-eavail-next-to-the-list_empty_careful-check +++ a/fs/eventpoll.c @@ -1828,6 +1828,7 @@ fetch_events: if (!eavail) timed_out = !schedule_hrtimeout_range(to, slack, HRTIMER_MODE_ABS); + __set_current_state(TASK_RUNNING); /* * We were woken up, thus go and try to harvest some events. @@ -1837,8 +1838,6 @@ fetch_events: eavail = 1; } while (0); - __set_current_state(TASK_RUNNING); - if (!list_empty_careful(&wait.entry)) { write_lock_irq(&ep->lock); /* _