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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C45CBC5320E for ; Mon, 19 Aug 2024 12:25:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 482F26B007B; Mon, 19 Aug 2024 08:25:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 432EF6B0082; Mon, 19 Aug 2024 08:25:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2D3E56B0083; Mon, 19 Aug 2024 08:25:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 0DC3D6B007B for ; Mon, 19 Aug 2024 08:25:22 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 80C9CA8899 for ; Mon, 19 Aug 2024 12:25:21 +0000 (UTC) X-FDA: 82468915242.26.18967CC Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf11.hostedemail.com (Postfix) with ESMTP id 816034002D for ; Mon, 19 Aug 2024 12:25:19 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=K6NRwKsT; spf=pass (imf11.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724070258; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Jn1DvOrWmKBpilai8HNN4+kVlfjx6rb9s0iUzARN26I=; b=iRc9sjfWfcQsUAcMj88UZtHryd9yAY71D3eqRuXg8XCFHIB3L46uzHbrQ9LXEhhdRn7WOV 9dflD92mXOpq6ykf1j7VSAa/PZ1vcsz6+nJVdJ7KHaLkyUNoWIdyVH8IJt/QuDAW1k76va Kdo6W3QYCHL8LZDNNU4hSyKRXhCclXA= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=K6NRwKsT; spf=pass (imf11.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724070258; a=rsa-sha256; cv=none; b=DN0oxPMSviFRMDg4FHq6H9RoqHAMSTjjn5X5VYj1pe83EBxtfP+SPhZPD8qlV+jfdaQFMW VHM8GjrAE4nKr7MEQSlPY2PUJIwap6iIO2nUwB1A13QAdXSMTxXr5SdnLg5JfBa6sYYwhq LRbby2watuyrmU10FRQuEZNS/EsvX3g= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724070318; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Jn1DvOrWmKBpilai8HNN4+kVlfjx6rb9s0iUzARN26I=; b=K6NRwKsTP52Gv3d8lAm0Kd9diwLdBKOcnrSlcIQU2VU+xm6pjRHX52nzdMxH8Ybd1FGT43 SnxOmRAdbVVzVLIbLHabHfSNiYdbN+ZODFJvuOoriOwKoYZuw68q/Jd5u9AW4sVbBGLZrd 74tjeTZhBp2XLLpvKYMw5mfHtN84X2o= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-458-jpvrPuE3PBWM5CJ5MOxA6g-1; Mon, 19 Aug 2024 08:25:15 -0400 X-MC-Unique: jpvrPuE3PBWM5CJ5MOxA6g-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F2F7A1955BFE; Mon, 19 Aug 2024 12:25:11 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.30]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 323B930001A1; Mon, 19 Aug 2024 12:25:05 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <20240818165124.7jrop5sgtv5pjd3g@quentin> <20240815090849.972355-1-kernel@pankajraghav.com> <2924797.1723836663@warthog.procyon.org.uk> <3141777.1724012176@warthog.procyon.org.uk> To: Hannes Reinecke Cc: dhowells@redhat.com, "Pankaj Raghav (Samsung)" , brauner@kernel.org, akpm@linux-foundation.org, chandan.babu@oracle.com, linux-fsdevel@vger.kernel.org, djwong@kernel.org, gost.dev@samsung.com, linux-xfs@vger.kernel.org, hch@lst.de, david@fromorbit.com, Zi Yan , yang@os.amperecomputing.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, willy@infradead.org, john.g.garry@oracle.com, cl@os.amperecomputing.com, p.raghav@samsung.com, mcgrof@kernel.org, ryan.roberts@arm.com Subject: Re: [PATCH v12 00/10] enable bs > ps in XFS MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3407980.1724070304.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Mon, 19 Aug 2024 13:25:05 +0100 Message-ID: <3407981.1724070305@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Stat-Signature: 9mf9x5oj9fnw6tmtyehtr8im5hq6frbh X-Rspam-User: X-Rspamd-Queue-Id: 816034002D X-Rspamd-Server: rspam02 X-HE-Tag: 1724070319-586992 X-HE-Meta: U2FsdGVkX19wfE/kHphGnt9bZya2+sZEjbFUU/uHUUIDrhhGYD6Tf/uYZjrhg0ZOxXsZDgCj+Pg4kHAS4U7ITOp94C+W8BotNOFhyB6xOfBOFtrnsg6lUFSsf38Rd9v+csFX/52Okr5hcHUpswY5iLQbamU/OrCSG4Or2lqlE0eBgk8bnVT6ZykOWGw/pFsBboFi8G4hJd0DZkapOr1KomHnoBUBxEE59LVp3roORjVZG+nU0J/ZZik4sPcBApaUHB4TMN2d3CmbWaNc2+F4IzuMwe/pwy6qpjQ4kyIgD9pPFmXC9esrgylQJ1/4woFZbrde8oKGv5j95Pfou304D6T9zbGImrGNneqcWgCJz/xfXIKkyd9EgctMbaTZoHvxI4PKCxPeSCvwXV0GfEmVNS5SpnujjRpvrcTVv3TkBJRAnhU1NHB0VDoaLZbeslBHol1eV1ancWWe4avyu7e78FNUFD8qUiWHb/i1+gLsElw/heO1R0uNimEtwZnRJiR8S7X7daMGQtuSGRzKXDAmR4Xqk5wQN/+NsUVORe80dCC4GWB1KzNTlyCUv2bS66sEQ3oSKELPusKU0ACpABCB0gxAlwnAbtjpLEbe7Hg4msS5K0xbay3rganV2T+pP8bKrd4YqlnhmdvHv9bMCe1dpTajCpXiMK8CxcHHItTFRTO3CpMd+usFtvi9R+Bl8RdUV02Gam3d2DGZV3n0Xjmw6BKapequhmCwTSDV1Pf1fOgS+OQOjTxcNC8exQMhttENMTnQo17CtGa8WVwSdNFLV3A+w6IHTSozK8gybFYFr/SlF7L3NPKzZRLanCKTMgu0OL5QA4ekj9SuwOp8luLQUAHy/VjsyjhAPOKFQ/fuKA+Qr7wRyI6wstY+/1fmd8pvW03MY/uwSbneZy+2mEApuLTx50rvYAORNjLqA91qhH1K0rMDoi5WEAKxNMTle37Y+G5u1Mm6IRRm7OPDERd YA+34o0f Yf2wwcLEHQPEgaA0dCk6AzXdN11K6cDv+upDN7vYM5sSGCn3YWiA/zJ2/bqfhzGrgMIv7itCQ/5ed28VM74k3dmOgUHNWcA4945Omf5y6+c+3GcwytlJlQnjQxkyceR2LSuKwzTDOC62o9zqq/16npdfwWE9Tb/IIn6jzAO8snosv7o65U6Bxht6gXUyyGa2pjID4vlYcCHUIGz/yfMyj53Hy4k8JrSIVB24m7iKEnK1oeHoIUFbtawKc9afFwdazvDlJcdidIlAr5XqQcAQLtI98X2UVnembkskT 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: List-Subscribe: List-Unsubscribe: Hannes Reinecke wrote: > IE you essentially nail AFS to use PAGE_SIZE. > Not sure how you would tell AFS to use a different block size; > maybe a mount option? As far as I know: sb->s_blocksize =3D PAGE_SIZE; sb->s_blocksize_bits =3D PAGE_SHIFT; isn't used by the VM. > Hmm. I'd rather fix the obvious places in afs first; just do a quick > grep for 'PAGE_', that'll give you a good impression of places to look a= t. Sure: fs/afs/dir.c: nr_pages =3D (i_size + PAGE_SIZE - 1) / PAGE_SIZE; fs/afs/dir.c: req->len =3D nr_pages * PAGE_SIZE; /* We can ask for mo= re than there is */ fs/afs/dir.c: task_io_account_read(PAGE_SIZE * req->nr_pages)= ; fs/afs/dir.c: folio =3D __filemap_get_folio(dir->i_mapping, c= tx->pos / PAGE_SIZE, fs/afs/xdr_fs.h:#define AFS_DIR_BLOCKS_PER_PAGE (PAGE_SIZE / AFS_DIR_BL= OCK_SIZE) Those only affect directories. fs/afs/mntpt.c: if (size < 2 || size > PAGE_SIZE - 1) That only affects mountpoint symlinks. fs/afs/super.c: sb->s_blocksize =3D PAGE_SIZE; This is the only thing (and sb->s_blocksize_bits) that might affect files.= I checked, and doubling this and adding 1 to bits does not alter the outcome= . Now, the VM wrangling is offloaded to netfslib, and most of that is to do = with converting between indices and file positions. Going through the usages o= f PAGE_SIZE there: fs/netfs/buffered_read.c: size +=3D PAGE_SIZE << order; That was recording the size of a folio readahead allocated. fs/netfs/buffered_read.c: size_t nr_bvec =3D flen / PAGE_SIZE + 2= ; fs/netfs/buffered_read.c: part =3D min_t(size_t, to - off= , PAGE_SIZE); Those two are used to fill in the gaps around a partial page - but that di= dn't appear in the logs. fs/netfs/buffered_write.c: pgoff_t index =3D pos / PAGE_SIZE; fs/netfs/buffered_write.c: fgp_flags |=3D fgf_set_order(po= s % PAGE_SIZE + part); Those two are used when asking __filemap_get_folio() to allocate a folio t= o write into. I got a folio of the right size and index, so that's not the problem. fs/netfs/fscache_io.c: pgoff_t first =3D start / PAGE_SIZE; fs/netfs/fscache_io.c: pgoff_t last =3D (start + len - 1) / PAGE_SIZE; Caching is not enabled at the moment, so these don't happen. fs/netfs/iterator.c: cur_npages =3D DIV_ROUND_UP(ret, PAGE_S= IZE); fs/netfs/iterator.c: len =3D ret > PAGE_SIZE ? PAGE_= SIZE : ret; I'm not doing DIO, so these aren't used. fs/netfs/iterator.c: pgoff_t index =3D pos / PAGE_SIZE; I'm not using an ITER_XARRAY iterator, so this doesn't happen. fs/netfs/misc.c: rreq->io_iter.count +=3D PAGE_SIZE << order; This is just multiplying up the folio size to add to the byte count. fs/netfs/read_collect.c: fsize =3D PAGE_SIZE << subreq->curr_fol= io_order; fs/netfs/read_collect.c: WARN_ON_ONCE(folioq_folio(folioq, s= lot)->index !=3D fpos / PAGE_SIZE)) { These two are converting between a file pos and an index - but only during read, and I can see from wireshark that we're writing the wrong data to th= e server before we get this far. And that's all the PAGE_SIZE usages in afs and netfslib. David