From owner-freebsd-fs@freebsd.org Thu Sep 21 10:59:02 2017 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED9C2E24628 for ; Thu, 21 Sep 2017 10:59:02 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wr0-x22b.google.com (mail-wr0-x22b.google.com [IPv6:2a00:1450:400c:c0c::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B6A474496 for ; Thu, 21 Sep 2017 10:59:02 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wr0-x22b.google.com with SMTP id l22so4295531wrc.10 for ; Thu, 21 Sep 2017 03:59:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=1g6fWncLWBjkoghq934lXgpyEneRk8N7Zp4Vi6hTYwM=; b=e3QHzpScvSm1+spgrcU6Q533cjV0gWF5GI2Z3ocD7R8kq/zt+XO+hRpnp2RFRYrTz9 dFmk3YHfDQiIOTKZzowC+xAd5+cOsDkP5aQC5r08o584qrcL8513y0a6SN2X4DYimyBm VZtpr6Sp3nASlqRXBgx2+txesY2ZemScxi8wXe11WOeCGeN4KOIYPDJ7vY3uDHL7qMGf 8yQk7CAFElJwe457Pu0CAeh8MQELdtifk9aRpkx613am9DIJk4LYeds3zND64yguNew5 rKpp6Z1QthF9EJICG9WHlmZ7Vy2WcPtytYer9DK9x9epsIhAwUcXJABv8IMTeLjjhmAh LVkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=1g6fWncLWBjkoghq934lXgpyEneRk8N7Zp4Vi6hTYwM=; b=p336YeoFQnrZSIvtQpWDYjva/hHVDQI+4Zff2/0h2JZdTSEY7/p/0Uss90+KJhoTJ3 dkxhmet0lNo1QX/VaUMTxIOVJBP53WmZAaIng/tRodwHh8TU5iKtZLZ/B+ETkb56tyVK 62mIKfqrY/HIbNDPV7wgARE/CSYqrr3+s9a9I1PN1CC+oK2fC075geHVHcy6Hv4Zc8xu nJSv5qz/7Ci8r36iqsjQFfp2IVgErr8OLkPosFmIznxM7JxzRAjc64d9AmP/KI3AfvFE hvuuP7MWiKBlsj3Y+34G/VpxoAZnJWpdlkrpN40c8VGB6/qlXaTdm0WU+jD4Ibjx3mHb HPJQ== X-Gm-Message-State: AHPjjUilrNIudDOU7bwQb6O5XYS2HOlgGOH8D0JlMeow13d3264VsAqy KJnp8wAuQj3+guf39AkDiFb9Gw== X-Google-Smtp-Source: AOwi7QCp2IWI7ccAvUyTeFmeFXqZVVEyQEbsuvecxhFOIeSuF82EDdrQS34c8l0vYhzzGL2wF3nCMw== X-Received: by 10.223.138.235 with SMTP id z40mr1670862wrz.14.1505991540845; Thu, 21 Sep 2017 03:59:00 -0700 (PDT) Received: from ernst.home (p4FCA62DB.dip0.t-ipconnect.de. [79.202.98.219]) by smtp.gmail.com with ESMTPSA id l91sm1021092wrc.16.2017.09.21.03.58.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Sep 2017 03:59:00 -0700 (PDT) Date: Thu, 21 Sep 2017 12:58:58 +0200 From: Gary Jennejohn To: Andreas Longwitz Cc: freebsd-fs@freebsd.org Subject: Re: fsync: giving up on dirty on ufs partitions running vfs_write_suspend() Message-ID: <20170921125858.64ffe077@ernst.home> In-Reply-To: <59C37F46.80509@incore.de> References: <201709110519.v8B5JVmf060773@chez.mckusick.com> <59BD0EAC.8030206@incore.de> <20170916183117.GF78693@kib.kiev.ua> <59C37F46.80509@incore.de> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.15.1 (GTK+ 2.24.31; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Sep 2017 10:59:03 -0000 On Thu, 21 Sep 2017 10:58:46 +0200 Andreas Longwitz wrote: [snip] > I have checked your proposal and found that indeed the > mnt_secondary_writes counter goes to zero when the dirties have reached > zero. During the loop the mnt_secondary_write counter is always equal to > one, so there is not something like a countdown and thats Kirk wanted to > see. A dtrace output (with DELAY of 1ms in the loop) for the biggest > loop count on a three day test is this: > > 18 32865 kern_unlinkat:entry path=bigfile, tid=101201, > tid=101201, execname=rm > 18 12747 ufs_remove:entry gj=mirror/gmbkp4p5.journal, > inum=11155630, blocks=22301568, size=11415525660 > 18 12748 ufs_remove:return returncode=0, inum=11155630, > blocks=22301568 > 18 18902 ffs_truncate:entry gj=mirror/gmbkp4p5.journal, > inum=11155630, size=11415525660, mnt_flag=0x12001040, > mnt_kern_flag=0x40006142, blocks=22301568 > 6 33304 vfs_write_suspend:entry gj=mirror/gmbkp4p5.journal, > mnt_kern_flag=0x40006142, tid=100181 > 6 22140 vop_stdfsync:entry mounted on /home, waitfor=1, > numoutput=0, clean=10, dirty=6, secondary_writes=1 > 10 28117 bufobj_wwait:return calls to bufobj_wait = 1, > dirtycnt=2, secondary_writes=1 > 10 28117 bufobj_wwait:return calls to bufobj_wait = 2, > dirtycnt=1, secondary_writes=1 > 10 28117 bufobj_wwait:return calls to bufobj_wait = 3, > dirtycnt=1, secondary_writes=1 > 10 28117 bufobj_wwait:return calls to bufobj_wait = 4, > dirtycnt=3, secondary_writes=1 > 10 28117 bufobj_wwait:return calls to bufobj_wait = 5, > dirtycnt=2, secondary_writes=1 > 6 28117 bufobj_wwait:return calls to bufobj_wait = 6, > dirtycnt=3, secondary_writes=1 > 6 28117 bufobj_wwait:return calls to bufobj_wait = 7, > dirtycnt=3, secondary_writes=1 > 6 28117 bufobj_wwait:return calls to bufobj_wait = 8, > dirtycnt=3, secondary_writes=1 > 6 28117 bufobj_wwait:return calls to bufobj_wait = 9, > dirtycnt=3, secondary_writes=1 > 6 28117 bufobj_wwait:return calls to bufobj_wait = 10, > dirtycnt=2, secondary_writes=1 > 6 28117 bufobj_wwait:return calls to bufobj_wait = 11, > dirtycnt=2, secondary_writes=1 > 6 28117 bufobj_wwait:return calls to bufobj_wait = 12, > dirtycnt=3, secondary_writes=1 > 6 28117 bufobj_wwait:return calls to bufobj_wait = 13, > dirtycnt=3, secondary_writes=1 > 6 28117 bufobj_wwait:return calls to bufobj_wait = 14, > dirtycnt=3, secondary_writes=1 > 6 28117 bufobj_wwait:return calls to bufobj_wait = 15, > dirtycnt=4, secondary_writes=1 > 6 28117 bufobj_wwait:return calls to bufobj_wait = 16, > dirtycnt=3, secondary_writes=1 > 6 28117 bufobj_wwait:return calls to bufobj_wait = 17, > dirtycnt=3, secondary_writes=1 > 2 18903 ffs_truncate:return returncode=0, inum=11155630, blocks=0 > 2 32866 kern_unlinkat:return returncode=0, errno=0, number > io's: 791/791 > 6 28117 bufobj_wwait:return calls to bufobj_wait = 18, > dirtycnt=3, secondary_writes=0 > 6 28117 bufobj_wwait:return calls to bufobj_wait = 19, > dirtycnt=0, secondary_writes=0 > 6 22141 vop_stdfsync:return returncode=0, pid=26, tid=100181, > spent 240373850 nsecs > > So the spent time in vop_stdfsync() is 0,24 sec in the worst case I > found using DELAY with 1 ms. I would prefer this solution. My first > appoach (simple bumping maxres from 1000 to 100000) is also ok, but max > spend time will be raise up to 0,5 sec. Perhaps you like something like > > if( maxretry < 1000 && maxretry % 10 = 0) ^ == > DELAY(waitns); > The argument to DELAY is in micro-seconds. -- Gary Jennejohn