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=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,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 47EBBC4361B for ; Thu, 17 Dec 2020 04:00:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D5E2123787 for ; Thu, 17 Dec 2020 04:00:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D5E2123787 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 138476B0036; Wed, 16 Dec 2020 23:00:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0E71D6B005D; Wed, 16 Dec 2020 23:00:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F18256B0068; Wed, 16 Dec 2020 23:00:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0029.hostedemail.com [216.40.44.29]) by kanga.kvack.org (Postfix) with ESMTP id DC1F86B0036 for ; Wed, 16 Dec 2020 23:00:46 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 8C072181AEF09 for ; Thu, 17 Dec 2020 04:00:46 +0000 (UTC) X-FDA: 77601422892.03.party12_620f8c627431 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id 66B9328A4E8 for ; Thu, 17 Dec 2020 04:00:46 +0000 (UTC) X-HE-Tag: party12_620f8c627431 X-Filterd-Recvd-Size: 2648 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf42.hostedemail.com (Postfix) with ESMTP for ; Thu, 17 Dec 2020 04:00:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=p5fb08C0DCBQWhSyoUlxYsa0SwQs8McabZN4Z0axm3U=; b=XiBh72ED9+K8bE59EDrVEXjQJu qIfZUDq6hJkumIIEpIHRg0voEtQynJ17re2x9bSCVY2i/vlsdfVDXb30Y8LXrNFJ9scswpt67nptt 9D81eP/etthk63EIvn7q6ECqFwegc6+mbNxwUbSW/qHzT58QuggfpvmQTAJFtd8ZtC6xyoGafSTWI 0NYLL3J0pamDEoqZsqZg8ssl6/9sHx5/GUo/BAfWV/2lE+8l8mikwTNDBZBc/eEUg73p4CwsYenru ZEE/S1rv25yYyDZSzgMyTgzhkEG0W5FDoVjegel4yNlPV5/9zmiBUKVegsyR3ROus9kdMoSDp/Swq JWcUeN8Q==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kpkSr-0003IO-Dp; Thu, 17 Dec 2020 04:00:29 +0000 Date: Thu, 17 Dec 2020 04:00:29 +0000 From: Matthew Wilcox To: Dave Chinner Cc: Yafang Shao , darrick.wong@oracle.com, hch@infradead.org, mhocko@kernel.org, akpm@linux-foundation.org, dhowells@redhat.com, jlayton@redhat.com, linux-fsdevel@vger.kernel.org, linux-cachefs@redhat.com, linux-xfs@vger.kernel.org, linux-mm@kvack.org, Michal Hocko , Christoph Hellwig Subject: Re: [PATCH v13 1/4] mm: Add become_kswapd and restore_kswapd Message-ID: <20201217040029.GC15600@casper.infradead.org> References: <20201217011157.92549-1-laoar.shao@gmail.com> <20201217011157.92549-2-laoar.shao@gmail.com> <20201217030609.GP632069@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201217030609.GP632069@dread.disaster.area> 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: On Thu, Dec 17, 2020 at 02:06:09PM +1100, Dave Chinner wrote: > On Thu, Dec 17, 2020 at 09:11:54AM +0800, Yafang Shao wrote: > > From: "Matthew Wilcox (Oracle)" > > > > Since XFS needs to pretend to be kswapd in some of its worker threads, > > create methods to save & restore kswapd state. Don't bother restoring > > kswapd state in kswapd -- the only time we reach this code is when we're > > exiting and the task_struct is about to be destroyed anyway. ... > > @@ -3932,8 +3920,6 @@ static int kswapd(void *p) > > goto kswapd_try_sleep; > > } > > > > - tsk->flags &= ~(PF_MEMALLOC | PF_SWAPWRITE | PF_KSWAPD); > > - > > Missing a restore_kswapd()? Deliberately.