From patchwork Thu Feb 9 19:43:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Foster X-Patchwork-Id: 9565467 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D0087601C3 for ; Thu, 9 Feb 2017 20:38:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C1B3E284EF for ; Thu, 9 Feb 2017 20:38:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B66652854F; Thu, 9 Feb 2017 20:38:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D3D9284EF for ; Thu, 9 Feb 2017 20:38:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753389AbdBIUiA (ORCPT ); Thu, 9 Feb 2017 15:38:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33084 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752697AbdBIUiA (ORCPT ); Thu, 9 Feb 2017 15:38:00 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C8FE02FD9A9; Thu, 9 Feb 2017 19:43:46 +0000 (UTC) Received: from bfoster.bfoster (dhcp-41-20.bos.redhat.com [10.18.41.20]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v19JhkNu001684; Thu, 9 Feb 2017 14:43:46 -0500 Received: by bfoster.bfoster (Postfix, from userid 1000) id 27746120211; Thu, 9 Feb 2017 14:43:45 -0500 (EST) From: Brian Foster To: fstests@vger.kernel.org Cc: linux-xfs@vger.kernel.org Subject: [PATCH 3/3] tests/xfs: update indlen res. test to include larger write pattern Date: Thu, 9 Feb 2017 14:43:44 -0500 Message-Id: <1486669424-45274-4-git-send-email-bfoster@redhat.com> In-Reply-To: <1486669424-45274-1-git-send-email-bfoster@redhat.com> References: <1486669424-45274-1-git-send-email-bfoster@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 09 Feb 2017 19:43:46 +0000 (UTC) Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The indirect blocks reservation test originally reproduced a problem with smaller delalloc extents being split into separate extents with insufficient indlen blocks. This was ultimately resolved by allowing to borrow blocks from the freed extent. Since then, similar problems have been reproduced when larger delalloc extents are repeatedly split and merged with new writes. These repeated splits exposed a problem in the old indlen reservation split algorithm when dealing with extents that are already under-reserved from previous splits. This resulted in unfair distribution of existing reservation and fairly large delalloc extents without any indlen reservation whatsoever. Enhance the original indlen reservation test to include a pattern that reproduces this behavior. Signed-off-by: Brian Foster --- tests/xfs/289 | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/tests/xfs/289 b/tests/xfs/289 index 3aa53b9..5839a24 100755 --- a/tests/xfs/289 +++ b/tests/xfs/289 @@ -85,10 +85,25 @@ done echo 0 > /sys/fs/xfs/$sdev/drop_writes -echo "Silence is golden." - _scratch_cycle_mount $XFS_IO_PROG -c 'bmap -vp' $file | _filter_bmap +# Now test a buffered write workload with larger extents. Write a 100m extent, +# split it at the 3/4 mark, then write another 100m extent that is contiguous +# with the 1/4 portion of the split extent. Repeat several times. This pattern +# is known to prematurely exhaust indirect reservations and cause warnings and +# assert failures. +rm -f $file +for offset in $(seq 0 100 500); do + $XFS_IO_PROG -fc "pwrite ${offset}m 100m" $file >> $seqres.full 2>&1 + + punchoffset=$((offset + 75)) + echo 1 > /sys/fs/xfs/$sdev/drop_writes + $XFS_IO_PROG -c "pwrite ${punchoffset}m 4k" $file >> $seqres.full 2>&1 + echo 0 > /sys/fs/xfs/$sdev/drop_writes +done + +echo "Silence is golden." + status=0 exit