Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp4365552pxb; Tue, 25 Jan 2022 08:53:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJy7glVbKQXGANhbw0GGI2Kw0CnSfC+PWZKuivjYTv+Fe6eSisr1nF9XzBQq5vBXIoAI2bpS X-Received: by 2002:a17:907:7f25:: with SMTP id qf37mr10522159ejc.9.1643129580167; Tue, 25 Jan 2022 08:53:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643129580; cv=none; d=google.com; s=arc-20160816; b=ePRHwgELSuS/XOmb+V6vTxretPklSspcZ8/nrOUloVCqcAfg8YvpFkkhOzJUMAMxtp ZPNdOuAFUR5jARunWSW16L7/SxvkC6uDLEq05U99IBir0iy/sb2OVu+UtvWLpcTJO65e pBEvNdiOLb2RIkgcsea2spLcIz+VfqxCYXiycIATPhWwiEB2FwC0zRFWY/f6CyON7U0w w71MhGrz/6KSrGoARD7dPqlChqw8Sb/rhtCBZmuHK0Ef//FkF7/OBg/U5UB7l3ewqNdO U71LweeGSdNVg1F3JnDOfUOx1pOb0WgbParC6RNC1PixuoVZjwHuuDjpb0+WXQ5IEu6f /EPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=hVqHXUz3Jk2sVZPobpwss8wYXdEwQhEkUDfTqU6jT1c=; b=O5c7Vtz9eo0zDdX24ollad0UvPOlUC02O3owTzxPTfBdwkOrtpw66R9MMM/+WH6cKG j9xBab0F5weUo45c4vQc9GOOPlyrZtZFw4fnA/eh2oFEpTzvagvS9SPwbS4Sj2HruCdS 3I5HdU47Gwgg3MGRVS36j8lKZ29EBkMkwle6f7kZA2hoEHW5natyGSJqUi86vtCcEzyV ClQVy/y9WMyfD0iVQCdjdYisR3A+oQYC1W6jZNd8jEzgW66mG827o2ssQ96VdpThxaRu f4z7EvYXxDepXVfdVMEl8HnTiABL8gaFS3dVnH4bPqr/TetcmY6daD1PXb53I/FX3aij 3/yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=tuKwVeRG; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=VCZjPdrG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 24si9270342eje.966.2022.01.25.08.52.26; Tue, 25 Jan 2022 08:53:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=tuKwVeRG; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=VCZjPdrG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1447778AbiAYMUN (ORCPT + 99 others); Tue, 25 Jan 2022 07:20:13 -0500 Received: from smtp-out2.suse.de ([195.135.220.29]:53356 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354562AbiAYMR6 (ORCPT ); Tue, 25 Jan 2022 07:17:58 -0500 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 770941F380; Tue, 25 Jan 2022 12:17:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1643113072; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hVqHXUz3Jk2sVZPobpwss8wYXdEwQhEkUDfTqU6jT1c=; b=tuKwVeRGyMDb2VZ7lsq2tT/lEEKkXD4V1KG7HhiPQXYjM1MMrNCHHZ7auGcys1mCftKDGC s0LWiIIeHKRISWuaIq2GSqcHD4RQYF2b627WVXxihUHuHddAruSb/ORBGoMtaYMNQ3u+JP 4v1SxOFrZZ3r+QYYJk3EgvhnrmZSj20= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1643113072; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hVqHXUz3Jk2sVZPobpwss8wYXdEwQhEkUDfTqU6jT1c=; b=VCZjPdrGnM7d1HUGXoXQd3hRCeAU1h0LWuD+W314V+Qhasb2GjNlTWFT4KaIBmvzXw7IVA cUB2oZsAwISCrDCg== Received: from quack3.suse.cz (unknown [10.163.43.118]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 60066A3B8A; Tue, 25 Jan 2022 12:17:52 +0000 (UTC) Received: by quack3.suse.cz (Postfix, from userid 1000) id 8EB67A05E6; Tue, 25 Jan 2022 13:17:46 +0100 (CET) Date: Tue, 25 Jan 2022 13:17:46 +0100 From: Jan Kara To: Richard Palethorpe Cc: Jan Kara , Cyril Hrubis , Miklos Szeredi , lkp@intel.com, Chi Wu , LKML , Jens Axboe , lkp@lists.01.org, kernel test robot , Sedat Dilek , Tejun Heo , Andrew Morton , Linus Torvalds , ltp@lists.linux.it Subject: Re: [LTP] [mm/page] ab19939a6a: ltp.msync04.fail Message-ID: <20220125121746.wrs4254pfs2mwexb@quack3.lan> References: <20210912123429.GA25450@xsang-OptiPlex-9020> <20210917121331.GA14905@quack2.suse.cz> <87o840xiel.fsf@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87o840xiel.fsf@suse.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 25-01-22 09:27:30, Richard Palethorpe wrote: > Hello, > > Jan Kara writes: > > > On Mon 13-09-21 10:11:22, Cyril Hrubis wrote: > >> Hi! > >> > FYI, we noticed the following commit (built with gcc-9): > >> > > >> > commit: ab19939a6a5010cba4e9cb04dd8bee03c72edcbd ("mm/page-writeback: Fix performance when BDI's share of ratio is 0.") > >> > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master > >> > > >> > > >> > in testcase: ltp > >> > version: ltp-x86_64-14c1f76-1_20210907 > >> > with following parameters: > >> > > >> > disk: 1HDD > >> > fs: xfs > >> > test: syscalls-03 > >> > ucode: 0xe2 > >> > > >> > test-description: The LTP testsuite contains a collection of tools for testing the Linux kernel and related features. > >> > test-url: http://linux-test-project.github.io/ > >> > >> The msync04 test formats a device with a diffrent filesystems, for each > >> filesystem it maps a file, writes to the mapped page and the checks a > >> dirty bit in /proc/kpageflags before and after msync() on that page. > >> > >> This seems to be broken after this patch for ntfs over FUSE and it looks > >> like the page does not have a dirty bit set right after it has been > >> written to. > >> > >> Also I guess that we should increase the number of the pages we dirty or > >> attempt to retry since a single page may be flushed to the storage if we > >> are unlucky and the process is preempted between the write and the > >> initial check for the dirty bit. > > > > Yes, I agree. The most likely explanation I see for this is that the > > identified commit results in waking flush worker earlier so it may now > > succeed in cleaning the page before get_dirty_bit() in the LTP testcase > > manages to see it. This is a principial race in this testcase, you can > > perhaps make it less likely but not completely fix it AFAICT. > > If the dirty bit is not set, then I guess dropping the pagecache will > not write anything to the underlying storage? Correct. > So when we see no dirty bit is set, we can drop the pagecache then read > the file to check the value was written correctly? If so then we can > exit with TCONF saying msync couldn't be tested because the storage was > written to too quickly. Yes, that would work. > Also I guess we can optimize the get_dirty_bit function. It's doing 3 > syscalls instead of 1 AFAICT. And this could reduce the race window. So nice I guess. But IMHO what would be a more sensible test is that msync is indeed persisting the data. So something like: mmap file, write to mmap, msync, abort fs, mount fs again, check the data is there. We do have framework for stuff like this in fstests (but we don't test msync AFAIK, only fsync), not sure if LTP has something for this as well. Honza -- Jan Kara SUSE Labs, CR