From patchwork Mon May 6 15:01:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Pankaj Raghav (Samsung)" X-Patchwork-Id: 13655613 Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [80.241.56.172]) (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 C4D80153583 for ; Mon, 6 May 2024 15:01:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.241.56.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715007697; cv=none; b=h/ovv/O0rMVvTOV2Z4lehBYNEsFHzjtz99cABC4r+JxFGSafbJFhsOWt11mPE0sBJCHP46E/wik0CY2KUVlY69Hx3f38LFmf8KUkAwkDI/No+U9S+y4gSB4sOfp2lUXZO5ia0/I/eAc4wKmj+x2y6kVwMN7pfCZlwaUECoHTq7I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715007697; c=relaxed/simple; bh=pyVga/tGoRiom70L3weUVuJjhdPXbIwuHY7iF/S8AWA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=a+On4Sd0bccmaHM3CjgrAH5QM8YeE/INWTrQ3K1c0w/BHhViLTpDjhaWb761ZcQdcPd6jJYslQTyz2ExFgyXEE8YQ5tSCFSF13AJxwI7gpaSo0Ulgs5MKv88VxK2wRGKR8qcZVuKW6jOpQGG9pauuTQkCzkPDeXjDtqwpcOelNM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pankajraghav.com; spf=pass smtp.mailfrom=pankajraghav.com; dkim=pass (2048-bit key) header.d=pankajraghav.com header.i=@pankajraghav.com header.b=xY0PYcNA; arc=none smtp.client-ip=80.241.56.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pankajraghav.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pankajraghav.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pankajraghav.com header.i=@pankajraghav.com header.b="xY0PYcNA" Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4VY4P21mRGz9sbY; Mon, 6 May 2024 17:01:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pankajraghav.com; s=MBO0001; t=1715007686; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Dw+jWdtRd8U7QJmF22ttCKm76KVLrDcwvD6Ap8URlF4=; b=xY0PYcNALN+6umn2ZxFlK2+8MBIAoNnqMJs2Ger7u5bWwUzqkUPyKeFy0eZaXxcMi7Ohgm X3HpyMOWC+DPXGSDM3HHbv70f4gmLp5i7kPhR09Ncjk4SgNnQrj7PYRL6ybTTlwIvlcxYG BJe2SChKHftxOV8xWk9wT+ZT7agZ21gCxTN5v1smHvQKGWSAPtAfpmszC1ufvOnuDaF1PU 6myn6/rY0aZ8dfCW9om66NAYb5RjU6d7UsCznEHdrvrkh0ZIaRytHWYsMKkWAzLrMC6Tlf fzNPPzj0aQmC1XjeUydGluyYsRwUhmkl0b/ENq6oWsts831kIs6tJ1u2MjowsQ== From: "Pankaj Raghav (Samsung)" To: fstests@vger.kernel.org Cc: djwong@kernel.org, gost.dev@samsung.com, mcgrof@kernel.org, kernel@pankajraghav.com, ritesh.list@gmail.com, zlang@redhat.com, Pankaj Raghav Subject: [PATCH 1/3] xfs/161: adapt the test case for 64k FS blocksize Date: Mon, 6 May 2024 17:01:17 +0200 Message-Id: <20240506150119.184097-2-kernel@pankajraghav.com> In-Reply-To: <20240506150119.184097-1-kernel@pankajraghav.com> References: <20240506150119.184097-1-kernel@pankajraghav.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Pankaj Raghav This test fails when xfs is formatted with 64k filesystem block size*. It fails because the soft quota is not exceeded with the hardcoded 64k pwrite, thereby, the grace time is not set. Even though soft quota is set to 12k for uid1, it is rounded up to the nearest blocksize. *** Report for user quotas on device /dev/sdb3 Block grace time: 7days; Inode grace time: 7days Block limits File limits User used soft hard grace used soft hard grace ---------------------------------------------------------------------- 0 -- 0 0 0 0 3 0 0 0 1 -- 64 64 1024 0 1 0 0 0 2 -- 64 0 0 0 1 0 0 0 Adapt the pwrite to do more than 64k write when the FS blocksize is 64k. Cap the blksz to be at least 64k to retain the same behaviour as before for smaller filesystem blocksizes. * This happens even on a 64k pagesize system and it is not related to LBS effort. Signed-off-by: Pankaj Raghav --- tests/xfs/161 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/xfs/161 b/tests/xfs/161 index 486fa6ca..94290f18 100755 --- a/tests/xfs/161 +++ b/tests/xfs/161 @@ -38,9 +38,15 @@ _qmount_option "usrquota" _scratch_xfs_db -c 'version' -c 'sb 0' -c 'p' >> $seqres.full _scratch_mount >> $seqres.full +min_blksz=65536 +file_blksz=$(_get_file_block_size "$SCRATCH_MNT") +# Write more than one block to exceed the soft block quota limit. +blksz=$(( 2 * $file_blksz)) + +blksz=$(( blksz > min_blksz ? blksz : min_blksz )) # Force the block counters for uid 1 and 2 above zero -_pwrite_byte 0x61 0 64k $SCRATCH_MNT/a >> $seqres.full -_pwrite_byte 0x61 0 64k $SCRATCH_MNT/b >> $seqres.full +_pwrite_byte 0x61 0 $blksz $SCRATCH_MNT/a >> $seqres.full +_pwrite_byte 0x61 0 $blksz $SCRATCH_MNT/b >> $seqres.full sync chown 1 $SCRATCH_MNT/a chown 2 $SCRATCH_MNT/b From patchwork Mon May 6 15:01:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Pankaj Raghav (Samsung)" X-Patchwork-Id: 13655614 Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [80.241.56.172]) (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 4DDDC153583 for ; Mon, 6 May 2024 15:01:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.241.56.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715007699; cv=none; b=azhgrNvgwgs5l6D9o8r2CmB+yWpsbTuWBrw5JKibWRE1vH7888oB02XLbJb3w+R0QMiV3o0IQyVHSmq8ZxeNbL1Op1PfXeClKM4qI1pe8xJuj/twp7PP0YwW5w+FPSl9AhguI15kUcuPbrhRON7hyoEWL3QW80jPBVRyK7+UpCU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715007699; c=relaxed/simple; bh=L4TG6tYj/GDWzFAr+TSLCyfSzEqEkJQwUyAoznr1w+s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=EAUmu4FoSqks4vVxwVVS68+L6qMgMF07XgV8TCGhMn4LR3NpQN0M59I4xA2PHNHmey0NFWUfWaaQ4XeedJQgoBdHexSFPMe11qR8pVdkfEZNqAynCgpnWUi6XXpzYHHxhp/JvwuCL/UdGdmVAuelFONe+vvW1eL63X6BURyuoX8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pankajraghav.com; spf=pass smtp.mailfrom=pankajraghav.com; dkim=pass (2048-bit key) header.d=pankajraghav.com header.i=@pankajraghav.com header.b=dKDtrPAl; arc=none smtp.client-ip=80.241.56.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pankajraghav.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pankajraghav.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pankajraghav.com header.i=@pankajraghav.com header.b="dKDtrPAl" Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4VY4P43fgRz9ssc; Mon, 6 May 2024 17:01:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pankajraghav.com; s=MBO0001; t=1715007688; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ns8OkHav60srMaqrqimDjhefxvSm/sAzGhfD09Rsuw4=; b=dKDtrPAlqhb7CyrBQfkEwxCRNOapT68f/Z8iLBqxleZusH4kAusgewLjEpAVbIUD/RuTC/ ZYm+hXI0MguKgpTzuT/kmi26cVJttHF1DgQ9dcUjwIH++8pfg1cITSyfkSvYQLRNm7x7cY VRm5cE0H9YXWzy6W0Qz7bTuGej9SccAjZ8Si7ubR3t0jDVMGUY8otQiFXOHdS5P5N/Ykl6 dsqDsz8b8Oe9FAIqhtpG3vGmp//yPf4ymaRM60EkgIewgFRXBuVizApVyTWuHeWwEY2fmR l9JoktMMc0XCdFdmvzZBx90n0m7oC2ZekYgnt2JY1lhjsxmSXoaFMcS5Eimbkg== From: "Pankaj Raghav (Samsung)" To: fstests@vger.kernel.org Cc: djwong@kernel.org, gost.dev@samsung.com, mcgrof@kernel.org, kernel@pankajraghav.com, ritesh.list@gmail.com, zlang@redhat.com, Pankaj Raghav Subject: [PATCH 2/3] generic/436: round up bufsz to nearest filesystem blksz Date: Mon, 6 May 2024 17:01:18 +0200 Message-Id: <20240506150119.184097-3-kernel@pankajraghav.com> In-Reply-To: <20240506150119.184097-1-kernel@pankajraghav.com> References: <20240506150119.184097-1-kernel@pankajraghav.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Pankaj Raghav SEEK_HOLE and SEEK_DATA work in filesystem block size granularity. So while filling up the buffer for test 13 - 16, round up the bufsz to the closest filesystem blksz. As we only allowed blocksizes lower than the pagesize, this was never an issue and it always aligned. Once we have blocksize > pagesize, this assumption will break. Fixes the test for LBS configuration. Signed-off-by: Pankaj Raghav Reviewed-by: Zorro Lang --- src/seek_sanity_test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/seek_sanity_test.c b/src/seek_sanity_test.c index 48b3ccc0..bc30f77c 100644 --- a/src/seek_sanity_test.c +++ b/src/seek_sanity_test.c @@ -541,7 +541,7 @@ static int test16(int fd, int testnum) { int ret = 0; char *buf = NULL; - int bufsz = sysconf(_SC_PAGE_SIZE); + int bufsz = roundup(sysconf(_SC_PAGE_SIZE) * 14, alloc_size); int filsz = 4 << 20; if (!unwritten_extents) { @@ -591,7 +591,7 @@ static int test15(int fd, int testnum) { int ret = 0; char *buf = NULL; - int bufsz = sysconf(_SC_PAGE_SIZE); + int bufsz = roundup(sysconf(_SC_PAGE_SIZE) * 14, alloc_size); int filsz = 4 << 20; if (!unwritten_extents) { @@ -643,7 +643,7 @@ static int test14(int fd, int testnum) { int ret = 0; char *buf = NULL; - int bufsz = sysconf(_SC_PAGE_SIZE) * 14; + int bufsz = roundup(sysconf(_SC_PAGE_SIZE) * 14, alloc_size); int filsz = 4 << 20; if (!unwritten_extents) { @@ -692,7 +692,7 @@ static int test13(int fd, int testnum) { int ret = 0; char *buf = NULL; - int bufsz = sysconf(_SC_PAGE_SIZE) * 14; + int bufsz = roundup(sysconf(_SC_PAGE_SIZE) * 14, alloc_size); int filsz = 4 << 20; if (!unwritten_extents) { From patchwork Mon May 6 15:01:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Pankaj Raghav (Samsung)" X-Patchwork-Id: 13655612 Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [80.241.56.151]) (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 CE412381AA for ; Mon, 6 May 2024 15:01:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.241.56.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715007695; cv=none; b=GllOxbIDWKuOGPaJyEcTI6X9RfEXnPBOouQH0MdlXhrOJcMWd4m/OfH4o0hXUNq8w6PyXfcNDknXSBa9NWc5Xwik2sW2N9jaXjTysySx1LSuyOb+0HFNoGW3aNnzCwcZPl9G/oC8bXelabsitqU8wZ+7HeGYHo3b3h7JmjLEuwg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715007695; c=relaxed/simple; bh=9W2sGn9wdTvsb3JWOMrBE6XRt62bAsJBPqJuqtkSBQY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Q5ZPrU4q/jZPaDY1r4fdehI1KPChBBknsZfwha+jAUoODawrSgLGWHUuTM+D1q9htmPaESl3+aI9zuql2ETdE4e2NVc89oCz/XfqAmuWXrYUxvbSZB9V+vKtIG9nSfdTyhd0yMji8rCK6gzEXOuuj44BBGM7az9jmecAZyGBdmo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pankajraghav.com; spf=pass smtp.mailfrom=pankajraghav.com; dkim=pass (2048-bit key) header.d=pankajraghav.com header.i=@pankajraghav.com header.b=TZeD/rUE; arc=none smtp.client-ip=80.241.56.151 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pankajraghav.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pankajraghav.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pankajraghav.com header.i=@pankajraghav.com header.b="TZeD/rUE" Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4VY4P62BNkz9srB; Mon, 6 May 2024 17:01:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pankajraghav.com; s=MBO0001; t=1715007690; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TGyfVBrG6tNYQTV0BLRkKxECl/ct9ngRV14U8/xO28s=; b=TZeD/rUEZF/ixuFRj6XG8uywzjCsHOOWFH95cER6OmnRkshLIwAdZlck64T/nmye3BsbyR kA4s5zshqOE6Ern7nLmtlXV7dkKl6dnhn6/QoAiQklekQRTwik7Tm58mhWwUMreLDI4IN8 1Z3rjGLLGulU7xwLBI0xPb3K30oG96rWeysKtWKGFe1AZrryNHjIctFjfXbQ+N+NgCXjag MSOyO7O3eEmlSb9dFPg3GdLoLvf9OC1nKKlmvOUYlxY8cpUfcHMoTa/aFuOxCtjuK+YPZl Ere812euqMlm62Ypb13oXET/uGQO8S8opiPd0Q2AYqh2s8Ztb+Oz2mlW5HIOiA== From: "Pankaj Raghav (Samsung)" To: fstests@vger.kernel.org Cc: djwong@kernel.org, gost.dev@samsung.com, mcgrof@kernel.org, kernel@pankajraghav.com, ritesh.list@gmail.com, zlang@redhat.com, Pankaj Raghav Subject: [PATCH 3/3] xfs/008: use block size instead of the pagesize Date: Mon, 6 May 2024 17:01:19 +0200 Message-Id: <20240506150119.184097-4-kernel@pankajraghav.com> In-Reply-To: <20240506150119.184097-1-kernel@pankajraghav.com> References: <20240506150119.184097-1-kernel@pankajraghav.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Pankaj Raghav The testcase estimates to have ratio of 1:3/4 for holes:filesize. This holds true where the blocksize is always less than or equal to pagesize and the total size of the file is calculated based on the pagesize. There is an implicit assumption that blocksize will always be less than the pagesize. LBS support will enable bs > ps where a minimum IO size is one block, which can be greater than a page. Adjust the size calculation to be based on the blocksize and not the pagesize. Signed-off-by: Pankaj Raghav Reviewed-by: Zorro Lang --- tests/xfs/008 | 19 ++++++++++--------- tests/xfs/008.out | 8 ++++---- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/tests/xfs/008 b/tests/xfs/008 index e7d6153b..e37e435a 100755 --- a/tests/xfs/008 +++ b/tests/xfs/008 @@ -11,7 +11,8 @@ _begin_fstest rw ioctl auto quick status=0 # success is the default! pgsize=`$here/src/feature -s` - +fileblksize=$(_get_file_block_size "$TEST_DIR") +blksize=$((fileblksize > pgsize ? fileblksize : pgsize)) # Override the default cleanup function. _cleanup() { @@ -21,7 +22,7 @@ _cleanup() _filter() { - sed -e "s/-b $pgsize/-b PGSIZE/g" \ + sed -e "s/-b $blksize/-b BLKSIZE/g" \ -e "s/-l .* -c/-l FSIZE -c/g" } @@ -73,17 +74,17 @@ _require_test # We are trying to create roughly 50 or 100 holes in a file # using random writes. Assuming a good distribution of 50 writes # in a file, the file only needs to be 3-4x the size of the write -# size muliplied by the number of writes. Hence we use 200 * pgsize -# for files we want 50 holes in and 400 * pgsize for files we want +# size muliplied by the number of writes. Hence we use 200 * blksize +# for files we want 50 holes in and 400 * blksize for files we want # 100 holes in. This keeps the runtime down as low as possible. # -_do_test 1 50 "-l `expr 200 \* $pgsize` -c 50 -b $pgsize" -_do_test 2 100 "-l `expr 400 \* $pgsize` -c 100 -b $pgsize" -_do_test 3 100 "-l `expr 400 \* $pgsize` -c 100 -b 512" # test partial pages +_do_test 1 50 "-l `expr 200 \* $blksize` -c 50 -b $blksize" +_do_test 2 100 "-l `expr 400 \* $blksize` -c 100 -b $blksize" +_do_test 3 100 "-l `expr 400 \* $blksize` -c 100 -b 512" # test partial blocks # rinse, lather, repeat for direct IO -_do_test 4 50 "-d -l `expr 200 \* $pgsize` -c 50 -b $pgsize" -_do_test 5 100 "-d -l `expr 400 \* $pgsize` -c 100 -b $pgsize" +_do_test 4 50 "-d -l `expr 200 \* $blksize` -c 50 -b $blksize" +_do_test 5 100 "-d -l `expr 400 \* $blksize` -c 100 -b $blksize" # note: direct IO requires page aligned IO # todo: realtime. diff --git a/tests/xfs/008.out b/tests/xfs/008.out index 5e3ae8e3..0941e218 100644 --- a/tests/xfs/008.out +++ b/tests/xfs/008.out @@ -1,10 +1,10 @@ QA output created by 008 -randholes.1 : -l FSIZE -c 50 -b PGSIZE +randholes.1 : -l FSIZE -c 50 -b BLKSIZE ------------------------------------------ holes is in range -randholes.2 : -l FSIZE -c 100 -b PGSIZE +randholes.2 : -l FSIZE -c 100 -b BLKSIZE ------------------------------------------ holes is in range @@ -12,10 +12,10 @@ randholes.3 : -l FSIZE -c 100 -b 512 ------------------------------------------ holes is in range -randholes.4 : -d -l FSIZE -c 50 -b PGSIZE +randholes.4 : -d -l FSIZE -c 50 -b BLKSIZE ------------------------------------------ holes is in range -randholes.5 : -d -l FSIZE -c 100 -b PGSIZE +randholes.5 : -d -l FSIZE -c 100 -b BLKSIZE ------------------------------------------ holes is in range