Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp16066lqs; Thu, 13 Jun 2024 02:19:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXicOcktSM6s40ernSQud70SYvOZTFuTnyASpWgO8E0WyC3f4Je/MKI6LvdohZmT7qCtT8x5ENkpL0dyPngHWLPTjcWfVerg+omZQXghQ== X-Google-Smtp-Source: AGHT+IGGKMNazve22Jd5Tq9luZkS9SXYNHzxf+z/anDVB58dWHEiIRua8SflUBzI6QCJNtP2oyci X-Received: by 2002:a05:622a:1103:b0:43a:f1f0:12f with SMTP id d75a77b69052e-4415ac6667fmr45613731cf.59.1718270379870; Thu, 13 Jun 2024 02:19:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718270379; cv=pass; d=google.com; s=arc-20160816; b=k55ls27EOhS4DtqHlq2Ml/jvUxAtqqTaMYAREhyxynRLCkSBb4WJOi00Yb80ayiEr6 oZmfk0zG8otphlELEtn03uMLgRiyB3pJhiWUer7MBnR2ZGASIW5ktce5UZ9HeH7Yo/52 wgD76Cwf5A7TpKUsPWIRjTSZxiCSwJo7yAhqr5fqnEhN0CuRygrOfz0kh76IqA4PT1y7 /0LMrRRdlaeKhQh6jEaHjVRmQSfPWnXhoPwadS3RdFLcsMCGmuwq8MjwNSyvPtLG9eoc TAE2ajhINT8NRrFdxC3UNKpkKH0DgM5fBXnav/Xhjz/VVwCdRhCYFtk1FGHeo8V19xdG YbHA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=v2l4H9/0TIhbVDIyz7qFryNEMUcK85C7IqEThXzsBJ4=; fh=+uWgxsSWHuCSXgmhevxSvZ4JDNPgzz87/v2C1+u0DeU=; b=kccdsqm88ERn0LcvcRbcSp6ywTgXN8pZ/EtF42QU9ESxJ/SMaX6z3Z6uueW+FiOncZ 5BKBgDfrEzqj6KWb+NCALpAbfKrqturkIY+AQL34JcvtF4XI8iVGS/7Bp48wbarE0baP IWyXsk9zj92ceyuyqWuQY//wRZInJCuXa75Hh0CU6pTUOE2Ragkqj4Kw4D2vA+FpsB9q pzQdItfvuPKoDnRyXEdDiAxYQU4vCWQIm9vxpnfH+CHWgkQc91WmUPQU9cS8QDbuJ6Fq Mei7Y8Qa6UoJYC6D11WZKbcF9VEtB88HD8yvcoJ9K0HSuv+t7wgKZQ32pabtaZICNfwI GKAw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-nfs+bounces-3750-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3750-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-441ef3b9646si10688921cf.138.2024.06.13.02.19.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 02:19:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-3750-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-nfs+bounces-3750-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3750-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 5CD221C2344D for ; Thu, 13 Jun 2024 09:19:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1680113D8A6; Thu, 13 Jun 2024 09:19:03 +0000 (UTC) X-Original-To: linux-nfs@vger.kernel.org Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 661CC13D26B for ; Thu, 13 Jun 2024 09:19:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718270343; cv=none; b=uHuMliE+nkA48UEpZafqWzIRsjuVwy3sKqP9JV0597YWNEtwwSbLQqm2InP6Z4LSDEQSe83M55c1thvkpIqk1cIb6cnUsZ7DNG+z4jDCkF5rLHWCBFBteZ0S6tQNuyzHcWTaDRDS/+KgbqFbI2ArLcZIIg5PoVhpsDllCdKZnkg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718270343; c=relaxed/simple; bh=sY+rV5gM0DvrpbhxJfj6lSbu5/W9HLT+PWNGVs20Bdk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=i+N6CDsU9CBPY1nr1f/TIZ54whAt7Nw+l0/L3QIy1Ay2iosm3Qoawsjxaheeuco6wJuCDLrdUgShcp/gLFEnB8ckeI9fhtUmZhcMRPyudCVnety5jmMkmBgER5fP7iW2dxcqudL99FgNW1lwgr8hESYpeiXpH8J0QB/+WQStaEw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=grimberg.me; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.221.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=grimberg.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-35f23f3da48so92856f8f.3 for ; Thu, 13 Jun 2024 02:19:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718270340; x=1718875140; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=v2l4H9/0TIhbVDIyz7qFryNEMUcK85C7IqEThXzsBJ4=; b=EQrbI8BrsT292bf3xUatAgbIdQz6lXc7YOiONwD6ELOoMqbocx3yegp7k8fMItejoV rYOGIMLkyITI2ACnf13HIAQ0bIE6tMJYUSB/W6xlhlzRW/+m6yigHhmIaR9hxEmn1aym konZ2Bf6KMWkX2hcmVurL3dVZBg3dP67+zSWFsgo08hi4FRxuZL1vcncP7VFuo1pHaMP 2ZzN/pDnB+13pSeE1KwNZJwcgVEFA+13A+5K0vo/y3h8eewW1cnFUHSFY/O08YtBPtCc ALRXEXvkCFYQd1KkcIzPf4ir4nunChRrCiLr1FDFoXGEYAItn6viapE3OJ9ibjGP7F+D lzAA== X-Gm-Message-State: AOJu0YyFwnPB4LBvIp7idWDGFt+7TX/MN5/Vn2sz1ntqv1vZs+ZKsdzW ghJgai+6gCcw8oL+iq+KQ7OFb/cIgsr/F8KoEVcSFBmqj0TnJ47q X-Received: by 2002:a5d:64cf:0:b0:35f:247e:fbcb with SMTP id ffacd0b85a97d-35fe88eb393mr3206569f8f.2.1718270339506; Thu, 13 Jun 2024 02:18:59 -0700 (PDT) Received: from [10.100.102.74] (46-117-188-129.bb.netvision.net.il. [46.117.188.129]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36075114dcfsm1102326f8f.114.2024.06.13.02.18.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 13 Jun 2024 02:18:59 -0700 (PDT) Message-ID: <6db728ea-8dc0-4d38-89e2-6ad7df537baf@grimberg.me> Date: Thu, 13 Jun 2024 12:18:57 +0300 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/3] nfs: Block on write congestion To: Jan Kara , Trond Myklebust Cc: linux-nfs@vger.kernel.org, Neil Brown References: <20240612153022.25454-1-jack@suse.cz> <20240613082821.849-3-jack@suse.cz> Content-Language: en-US From: Sagi Grimberg In-Reply-To: <20240613082821.849-3-jack@suse.cz> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 13/06/2024 11:28, Jan Kara wrote: > Commit 6df25e58532b ("nfs: remove reliance on bdi congestion") > introduced NFS-private solution for limiting number of writes > outstanding against a particular server. Unlike previous bdi congestion > this algorithm actually works and limits number of outstanding writeback > pages to nfs_congestion_kb which scales with amount of client's memory > and is capped at 256 MB. As a result some workloads such as random > buffered writes over NFS got slower (from ~170 MB/s to ~126 MB/s). The > fio command to reproduce is: > > fio --direct=0 --ioengine=sync --thread --invalidate=1 --group_reporting=1 > --runtime=300 --fallocate=posix --ramp_time=10 --new_group --rw=randwrite > --size=64256m --numjobs=4 --bs=4k --fsync_on_close=1 --end_fsync=1 > > This happens because the client sends ~256 MB worth of dirty pages to > the server and any further background writeback request is ignored until > the number of writeback pages gets below the threshold of 192 MB. By the > time this happens and clients decides to trigger another round of > writeback, the server often has no pages to write and the disk is idle. > > To fix this problem and make the client react faster to eased congestion > of the server by blocking waiting for congestion to resolve instead of > aborting writeback. This improves the random 4k buffered write > throughput to 184 MB/s. Nice, Reviewed-by: Sagi Grimberg