From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Wilcox Date: Tue, 23 May 2023 04:30:51 +0100 Subject: [Cluster-devel] [PATCH 08/13] iomap: assign current->backing_dev_info in iomap_file_buffered_write In-Reply-To: <20230523010627.GD11598@frogsfrogsfrogs> References: <20230519093521.133226-1-hch@lst.de> <20230519093521.133226-9-hch@lst.de> <20230523010627.GD11598@frogsfrogsfrogs> Message-ID: List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Mon, May 22, 2023 at 06:06:27PM -0700, Darrick J. Wong wrote: > On Fri, May 19, 2023 at 11:35:16AM +0200, Christoph Hellwig wrote: > > Move the assignment to current->backing_dev_info from the callers into > > iomap_file_buffered_write to reduce boiler plate code and reduce the > > scope to just around the page dirtying loop. > > > > Note that zonefs was missing this assignment before. > > I'm still wondering (a) what the hell current->backing_dev_info is for, > and (b) if we need it around the iomap_unshare operation. > > $ git grep current..backing_dev_info [results show it only set, never used] > > AFAICT nobody uses it at all? Unless there's some bizarre user that > isn't extracting it from @current? > > Oh, hey, new question (c) isn't this set incorrectly for xfs realtime > files? Some git archaelogy ... This was first introduced in commit 2f45a06517a62 (in the linux-fullhistory tree) in 2002 by one Andrew Morton. At the time, it added this check to the page scanner: + if (page->pte.direct || + page->mapping->backing_dev_info == + current->backing_dev_info) { + wait_on_page_writeback(page); + } AFAICT (the code went through some metamorphoses in the intervening twenty years), the last use of it ended up in current_may_throttle(), and it was removed in March 2022 by Neil Brown in commit b9b1335e6403. Since then, there have been no users of task->backing_dev_info, and I'm pretty sure it can go away.