Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp221855lqa; Fri, 26 Apr 2024 22:56:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV4mhqQpwVfMMs33zK5o0AcYBPpfKsa1EzojYeBqztUXu5j/F9NCooRSjLNza2ICRxQ3ffGg7/ImpFp3+iwyGbPTMN7MeFWIq67RVJZGQ== X-Google-Smtp-Source: AGHT+IFJkIxJ5AgftzFSB9VtnN864DDulYofQL+1H4wP0vkri7c8TzHKIF4VSR5IJSieRLaXbYkg X-Received: by 2002:a05:6a20:9152:b0:1aa:6a28:cf6e with SMTP id x18-20020a056a20915200b001aa6a28cf6emr5587877pzc.48.1714197370223; Fri, 26 Apr 2024 22:56:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714197370; cv=pass; d=google.com; s=arc-20160816; b=XTDIj9HKdFXsbZUdyV2PaBkkU70Ke3bAUjStK/bcrdbLXy6QvStJ3bWlCqZS2nktOs JofWBtnww7hUuY7NdyATDAQOZ2dBzNAFGu3cvumLxbCSzMmL0SlWROL+62udl66PKK5Y lQjJ8e8GJGT72smDPis6qm2ZaxazdXTCe5jC/c1yo/1F6LflvLH1xJGZStwiFhYzewgH 6PPKnlU9WLsPbwJgA5KO3yFM5rFRNQVQggDT7hKcbpGfMawBvW91chMbuPIfDLsaRSaW rQVw4Yyeq9A4YxvagAK3N7rdN+k5bS8AQ7/LfhL8HIqNaOPsj/0CnMA2MbDrE3meIbn6 qzDQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5v6AQgZQjyOeRuTWmiZF8n0lMYbUyrVMuDyPiZp+bGA=; fh=di3EMk5X0RxZhgDyH1bYU8v9hSTyWJZJJ0sEj7++Blc=; b=Wx14/po9fJjjjKJOYtQOFzUPbadUUGbGAuXc19ywSX8Fslo+3M2wqgRq5Ch9EMmlsg 2gI+o+Naxr86RAxaZgcWBJ/IPY17p5vBpTz90/4pl/SK7ATxWUliNJQFPcA+7Ab5J8no wPoWGImK5/XB9pMtlHbCerv5NKMeY4lxE1Tg34JFI+C3EAEyA+X838WFrxEJuWT7SUqr uoNjq/Oy63ecJmwOQsz/JdYKzbDl63DI5LEphCmq+iKCENo+NvepmBHNwgGIoJLndGz3 fpbKbKtbbh/uT//7q0K4kUntcj3+dRkr4fJ8Cy8YP8e08rRF55pfXbSkmoDQH+Dswlm4 L4QA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=SAuVtdZF; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-160878-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160878-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id v21-20020a056a00149500b006ea7f4aed70si16368754pfu.199.2024.04.26.22.56.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 22:56:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160878-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=SAuVtdZF; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-160878-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160878-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id C9784B21F40 for ; Sat, 27 Apr 2024 03:27:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DE0523C482; Sat, 27 Apr 2024 03:26:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="SAuVtdZF" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F1DFB383B1; Sat, 27 Apr 2024 03:26:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714188417; cv=none; b=G5e2nXRJvSbSPymOApFAHFTQVY+Mb/YWYehM0LIsG444VIVIAQvxTlC2t5whitpnaVhW0fjV/A+axp/EiqldAAzsKv8BSufWRxgRfc1aBwMVtpM77gZgMHiP8vl6Qi7v0GciMCYt26TzS5WHm4Q/9qLQJ53Dnk/n93fdbXgJu/Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714188417; c=relaxed/simple; bh=rpuR8yy1xjzC30bcQqsO07LuNXGEevgvwHEcSYerdeM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=q8jLS6Jcbl9UM3hn410zKo4Ovz9OzaOPHObeGswpHtNkJYAU1LfiePMkRhTkM1iwis8vF73ZiNdyN1NjmIt0TwFklXRCfrSuM9M4cmMwfW3C6SiSn46cEikSb24qp9gNqj7dI9vrrN5UpJfvgl3/9uJlH2ZVCn5L8FM3b/J29Do= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=SAuVtdZF; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org 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=5v6AQgZQjyOeRuTWmiZF8n0lMYbUyrVMuDyPiZp+bGA=; b=SAuVtdZFgtlC5/s8e3mzOSRlKV BnMVkhauKdWMzRFJO8w3xTA2ElRZcxShO2vVWW+uCiwumTOxuOfwej3B9mS+FNlQRDe/NR0Zw6e8C z1Jx6rtjKX5dFDw21FlGbF4hQLH33bThbEbQcxeGrFnNnYoLjkplh4uw3lCpfNlH66LuFAPoneK5n b3KhG/3zzpCwzWKR60npeaC1LfLPK5NEM8LdCZozpP2F9JlIxtvO+4/kmpZIGhyt8uHVay8rOD77X mfivdSttI7aE7keKZm0sWYxdsPgMuNFZHYq1VvNtHBwEF6vzdapQMvt+tjyn/bFTvc8QRK/YEwXwk 8Nm4zGQg==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1s0Yi4-00000006aiS-2RiT; Sat, 27 Apr 2024 03:26:44 +0000 Date: Sat, 27 Apr 2024 04:26:44 +0100 From: Matthew Wilcox To: Christoph Hellwig Cc: "Pankaj Raghav (Samsung)" , djwong@kernel.org, brauner@kernel.org, david@fromorbit.com, chandan.babu@oracle.com, akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org, hare@suse.de, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-xfs@vger.kernel.org, mcgrof@kernel.org, gost.dev@samsung.com, p.raghav@samsung.com Subject: Re: [PATCH v4 07/11] iomap: fix iomap_dio_zero() for fs bs > system page size Message-ID: References: <20240425113746.335530-1-kernel@pankajraghav.com> <20240425113746.335530-8-kernel@pankajraghav.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Apr 25, 2024 at 11:22:35PM -0700, Christoph Hellwig wrote: > On Thu, Apr 25, 2024 at 01:37:42PM +0200, Pankaj Raghav (Samsung) wrote: > > From: Pankaj Raghav > > > > iomap_dio_zero() will pad a fs block with zeroes if the direct IO size > > < fs block size. iomap_dio_zero() has an implicit assumption that fs block > > size < page_size. This is true for most filesystems at the moment. > > > > If the block size > page size, this will send the contents of the page > > next to zero page(as len > PAGE_SIZE) to the underlying block device, > > causing FS corruption. > > > > iomap is a generic infrastructure and it should not make any assumptions > > about the fs block size and the page size of the system. > > So what happened to the plan to making huge_zero_page a folio and have There's a series of commits in linux-mm with the titles: sparc: use is_huge_zero_pmd() mm: add is_huge_zero_folio() mm: add pmd_folio() mm: convert migrate_vma_collect_pmd to use a folio mm: convert huge_zero_page to huge_zero_folio mm: convert do_huge_pmd_anonymous_page to huge_zero_folio dax: use huge_zero_folio mm: rename mm_put_huge_zero_page to mm_put_huge_zero_folio > it available for non-hugetlb setups? Not only would this be cleaner > and more efficient, but it would actually work for the case where you'd > have to zero more than 1MB on a 4k PAGE_SIZE system, which doesn't > seem impossible with 2MB folios. It is available for non-hugetlb setups. It is however allocated on demand, so it might not be available.