Thread (30 messages) 30 messages, 4 authors, 2021-03-23

Re: [PATCH v4 08/28] netfs: Provide readahead and readpage netfs helpers

From: David Howells <dhowells@redhat.com>
Date: 2021-03-22 17:14:46
Also in: ceph-devel, linux-cifs, linux-fsdevel, linux-nfs, lkml

Matthew Wilcox [off-list ref] wrote:
quoted
+	while ((page = readahead_page(ractl)))
+		put_page(page);
You don't need this pair of lines (unless I'm missing something).
read_pages() in mm/readahead.c puts the reference and unlocks any
pages which are not read by the readahead op.  Indeed, I think doing
this is buggy because you don't unlock the page.
Actually, I do need them.  The pages haven't been removed from the ractl at
this point so just returning would cause them all to be unlocked prematurely.

I don't pass the ractl to the filesystem or the cache because I may be calling
them for partial pages, I may be issuing multiple ops sequentially on a page
and the ractl may have ceased to exist by the time I issue an op.

The unlocking is done by netfs_rreq_unlock(), even for pages that didn't get
read.

I've added a comment to this effect.

David

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help