Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2792924pxk; Tue, 15 Sep 2020 02:27:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUogf2jPsbSZPqN9pJ+rQmz01VNpFQsjXNgaVbFYubeYhK4Oa8c5v/macNLCCRuSHDtPh2 X-Received: by 2002:aa7:dcd2:: with SMTP id w18mr21776762edu.288.1600162076747; Tue, 15 Sep 2020 02:27:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600162076; cv=none; d=google.com; s=arc-20160816; b=rfwFz10ApGKRO/QeGz8mBK4MxMXvV+/cluZydhkgBD8nyRnZ+cqQJUIg0lYE1j3+m1 bvMEH65mtCJwfaO1dk4ZEOAJ7AKzpCVlwqgGffXLd4FgucORE+ndhdtluw6S2XuwkR// hz7D8f8m81L423oQnux4/f4QcO7KDXzlu/8jJs4F+ObgdWBrrm7oZKcuTpdnGcPdX/9F nuKX0PQgvoUVB48daQAaFpWcrdNovs5O8vI9zsiNMlPB/13EsAL2V2yxU0DPKQOVW9WL jgGYJoX/Wce7Zfl4HdRfBKVMgQk6NUco9h9yuTHFIOvlVrlfCQVM/KBlcGDv1i0W0XS5 Pyiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=N+88Ig2dOU/C+2pHci95nPZjdx1Gfv7Y6m3RgLdGE0M=; b=qzyPgUKeurlJWPvxVNRtUAU0YstJA//p+kxhY8g94jvEkQqK7bSotYY+6DSnrBulhO quK8r2KxRJHrDc+TI1/ghWcbm+IQkKnN3aaP4VpMwI1ZimsUcuSoksF5eS4HsKodM6SW KmkfbWfIr+1XdSHm0RVo7xsAMy82CcM1VQ6qEzs7rqfQhbeP1IWOyF4RyRK5/qDZGayO WdIV9waXmbHtWyq542/HMyFxA9SRIIXa/SGBeWjUvlmZ/5VK1Bu+r5QiSFoUB2q6qCPo 1leA+12hntVe80EqbtfR87G3ZRSirkBLJ7MUK9yFj15StIlHuNPJVkDZPdNFy8EJdFz5 JDqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f9si8378927ejq.641.2020.09.15.02.27.26; Tue, 15 Sep 2020 02:27:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726276AbgIOJ1V (ORCPT + 99 others); Tue, 15 Sep 2020 05:27:21 -0400 Received: from mx2.suse.de ([195.135.220.15]:40574 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726102AbgIOJ1V (ORCPT ); Tue, 15 Sep 2020 05:27:21 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 2BE5DAC24; Tue, 15 Sep 2020 09:27:35 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 4AD6B1E12EF; Tue, 15 Sep 2020 11:27:19 +0200 (CEST) Date: Tue, 15 Sep 2020 11:27:19 +0200 From: Jan Kara To: Dave Chinner Cc: Linus Torvalds , Amir Goldstein , Hugh Dickins , Michael Larabel , Ted Ts'o , Andreas Dilger , Ext4 Developers List , Jan Kara , linux-fsdevel Subject: Re: Kernel Benchmarking Message-ID: <20200915092719.GI4863@quack2.suse.cz> References: <0cbc959e-1b8d-8d7e-1dc6-672cf5b3899a@MichaelLarabel.com> <20200913004057.GR12096@dread.disaster.area> <20200913234503.GS12096@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200913234503.GS12096@dread.disaster.area> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon 14-09-20 09:45:03, Dave Chinner wrote: > I have my doubts that complex page cache manipulation operations > like ->migrate_page that rely exclusively on page and internal mm > serialisation are really safe against ->fallocate based invalidation > races. I think they probably also need to be wrapped in the > MMAPLOCK, but I don't understand all the locking and constraints > that ->migrate_page has and there's been no evidence yet that it's a > problem so I've kinda left that alone. I suspect that "no evidence" > thing comes from "filesystem people are largely unable to induce > page migrations in regression testing" so it has pretty much zero > test coverage.... Last time I've looked, ->migrate_page seemed safe to me. Page migration happens under page lock so truncate_inode_pages_range() will block until page migration is done (and this covers currently pretty much anything fallocate related). And once truncate_inode_pages_range() is done, there are no pages to migrate :) (plus migration code checks page->mapping != NULL after locking the page). But I agree testing would be nice. When I was chasing a data corruption in block device page cache caused by page migration, I was using thpscale [1] or thpfioscale [2] benchmarks from mmtests which create anon hugepage mapping and bang it from several threads thus making kernel try to compact pages (and thus migrate other pages that block compaction) really hard. And with it in parallel I was running the filesystem stress that seemed to cause issues for the customer... I guess something like fsx & fsstress runs with this THP stress test in parallel might be decent fstests to have. Honza [1] https://github.com/gormanm/mmtests/blob/master/shellpack_src/src/thpscale/thpscale.c [2] https://github.com/gormanm/mmtests/blob/master/shellpack_src/src/thpfioscale/thpfioscale.c -- Jan Kara SUSE Labs, CR