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=-2.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 A2FF2C2BB48 for ; Tue, 15 Dec 2020 04:39:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 246A8207DE for ; Tue, 15 Dec 2020 04:39:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 246A8207DE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 77D1E8D0007; Mon, 14 Dec 2020 23:39:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7522C8D0005; Mon, 14 Dec 2020 23:39:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 668878D0007; Mon, 14 Dec 2020 23:39:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0254.hostedemail.com [216.40.44.254]) by kanga.kvack.org (Postfix) with ESMTP id 501E28D0005 for ; Mon, 14 Dec 2020 23:39:42 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 03B921E02 for ; Tue, 15 Dec 2020 04:39:41 +0000 (UTC) X-FDA: 77594263404.30.angle97_621450727420 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin30.hostedemail.com (Postfix) with ESMTP id D402F180B3AB8 for ; Tue, 15 Dec 2020 04:39:41 +0000 (UTC) X-HE-Tag: angle97_621450727420 X-Filterd-Recvd-Size: 4726 Received: from mail-io1-f66.google.com (mail-io1-f66.google.com [209.85.166.66]) by imf33.hostedemail.com (Postfix) with ESMTP for ; Tue, 15 Dec 2020 04:39:41 +0000 (UTC) Received: by mail-io1-f66.google.com with SMTP id w18so5338601iot.0 for ; Mon, 14 Dec 2020 20:39:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eZpMSPWj4XpZ3thlAzvu56DgfsvqpomnX3VopvGqVOs=; b=V/a9QAKPx8DgB+4XXpXqICtMSlaSE25WJ7EJmPHUOuYhR4sEK0rOQVMjP/J53ayazG R4n+7D3icF6qug0Wqr1+o2+CDKC+IfmAW6ZbXW5l3ne1nDcpvKecqX1G6COZS8w3/OS9 od3iLRkc8Uos9IbacbYGv5gWK6YQVuUm+Qum2CdGkOPs6wKhfR0VXRuNE5g/g/8kbhwr FdgFzgbqCmA3Z+KbIoEFjeQxXnWbOJfytkPPJ3avbVCDIaL2SM+k+72q47F4rXl4Dj3m XVzdnO7nDSMr7zCW02QABzTsiIyoYONzXKqrsz4/Le+zRThRK3Wm9eTMzlX4WWcqqrO9 JO1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eZpMSPWj4XpZ3thlAzvu56DgfsvqpomnX3VopvGqVOs=; b=skWo1zTVw8GyzoNMIgnCj/zn6gkPdhmefKHVlSd0fOMvhI5uSvpIKsc6EndYdvBQSr B6cSCXppkTMe3X8rmYrXOLEbrJrWIuzESTZjxDxdQdrfdAYJeIBpRxs2mccnzAQt+pZY sgagmusi87wBSWZEVo4bae8rhfhk7niAsv5N35/4cc8hxkrtXX/uEDMbCj39Zf5r8ML3 U1Q8mvXAMOQ79UGTrYLlgGU5sNz51KGPn7ojMlaoGs8ErNbQN5o1r7f7BSRn0hs8oDa3 6D9wy2mMcolOIydMyO6hvdTRRYHunNOtjFKpHLQ8Mw5sIIw5zbTedj+IpmNeWS78JVWf i3rw== X-Gm-Message-State: AOAM533NstLOiga10jMUs3MgJhOSHW4QD3/2M1iETqVSVUPkEL+zM4ly bwef9xO4GfNW/0QqmyD3R/q87K9H3Cn7vBMChBE= X-Google-Smtp-Source: ABdhPJz5tqAgMHotC0ERTj7zEoC52sQPoOS/rmGpHPpLK7dh8dJAOI6n+d/eAqkIo1EpDGfAFFhkyGH6jgFwEVtRovM= X-Received: by 2002:a02:a152:: with SMTP id m18mr37230897jah.64.1608007180900; Mon, 14 Dec 2020 20:39:40 -0800 (PST) MIME-Version: 1.0 References: <20201209131146.67289-1-laoar.shao@gmail.com> <20201209131146.67289-4-laoar.shao@gmail.com> <20201209195235.GN1943235@magnolia> <20201214210833.GE632069@dread.disaster.area> <20201215011240.GJ632069@dread.disaster.area> In-Reply-To: <20201215011240.GJ632069@dread.disaster.area> From: Yafang Shao Date: Tue, 15 Dec 2020 12:39:05 +0800 Message-ID: Subject: Re: [PATCH v12 3/4] xfs: refactor the usage around xfs_trans_context_{set,clear} To: Dave Chinner Cc: "Darrick J. Wong" , Matthew Wilcox , Christoph Hellwig , Michal Hocko , Andrew Morton , David Howells , jlayton@redhat.com, linux-fsdevel@vger.kernel.org, linux-cachefs@redhat.com, linux-xfs@vger.kernel.org, Linux MM , Christoph Hellwig Content-Type: text/plain; charset="UTF-8" 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 Tue, Dec 15, 2020 at 9:12 AM Dave Chinner wrote: > > On Tue, Dec 15, 2020 at 08:42:08AM +0800, Yafang Shao wrote: > > On Tue, Dec 15, 2020 at 5:08 AM Dave Chinner wrote: > > > On Sun, Dec 13, 2020 at 05:09:02PM +0800, Yafang Shao wrote: > > > > On Thu, Dec 10, 2020 at 3:52 AM Darrick J. Wong wrote: > > > > > On Wed, Dec 09, 2020 at 09:11:45PM +0800, Yafang Shao wrote: > > > static inline void > > > xfs_trans_context_clear(struct xfs_trans *tp) > > > { > > > /* > > > * If xfs_trans_context_swap() handed the NOFS context to a > > > * new transaction we do not clear the context here. > > > */ > > > if (current->journal_info != tp) > > > > current->journal_info hasn't been used in patch #3, that will make > > patch #3 a little more complex. > > We have to do some workaround in patch #3. I will think about it. > > What I wrote is how the function should look at the end of the patch > series. Do not add the current->journal_info parts of it until the > patch that introduces the current->journal_info tracking. > I know what you meant. While I mean we have to do some hack, as suggested by Darrrick that "set NOFS in the old transaction's t_pflags so that when we clear the context on the old transaction we don't actually change the thread's NOFS state." in patch #3 and then remove it in patch #4. -- Thanks Yafang