Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2213458pxb; Fri, 25 Mar 2022 13:09:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpwmvc/Bkhalwz8B08ynpuIEGNMyh2o1iyl60C11TayOBNfCRwH53I7+ksFrr+XNIKmSDX X-Received: by 2002:a17:90a:d0c4:b0:1bc:b02e:ed75 with SMTP id y4-20020a17090ad0c400b001bcb02eed75mr27336746pjw.104.1648238993249; Fri, 25 Mar 2022 13:09:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648238993; cv=none; d=google.com; s=arc-20160816; b=PpgX1aiDN5hWk7Mbx5AKt0tQuHsXNIdkTSuZrF0scYHS/qkDVEsghRoQl2T0L5DnGs Tl09+5ZfsCTlv7izwGWDFefk+59bpittCkG8BA2hwTsdyBPb8UgY/37PsKIvCxR43P2L 3LfFiX7e3JGsJ4EEQV5nCZk+6Lup+aLv21tLlSFPx89WN6Z/DZSwrHav1LlSopSI1A5O MrlUxTcqKFwA7X7E7F6iC3kvzNsQUdfceiS46nLmgLjZWiUrSCGLZ9/WTBXFzA8REUSK N2O4nrgmAtrrQR1qL6CPxChclC0020ddrMQzruJ/DocJy6OhFPqtyvhUXoshOLUh+zJV qarg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=yPjA/sNpnOcC3OZqw/MwHjQE8KDwlLZ97r+qgQx76dw=; b=lpucEToS8dFcu4HaybH4q8BHP0BYGDukUqJxNVVzFy9Ls2mHqj4G3jeMGJRCty89wR Sq/yDSNUeDV0nxwqLbrVIeystMGOw1P0INqWvkeHx1r1A/iPOGaWjsqiFwPomlqTD5kv 0bapJtmc9AcPB80pi841Atsu86fanU22HiPjDywyW2WM/LBeVMudk7oEghuKLZKFWaZQ w59SQgepGCcAooR/MGYpb8n+S0O1sIg7n8zXUDoSC4Q7hUfEqIH9sWzBpZ/7ZE4PVkLa NnAsfOWH6QvDzhDR1CRhHW1x64g7nDdxu8nhpfzsYwL+luAoMGBps+96niytHmW48r9k /VKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XagkBYa0; spf=softfail (google.com: domain of transitioning linux-nfs-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id p66-20020a625b45000000b004fb04dde469si3513909pfb.23.2022.03.25.13.09.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 13:09:53 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-nfs-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XagkBYa0; spf=softfail (google.com: domain of transitioning linux-nfs-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B674F39DC41; Fri, 25 Mar 2022 11:52:30 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244732AbiCYMdU (ORCPT + 99 others); Fri, 25 Mar 2022 08:33:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359165AbiCYMdG (ORCPT ); Fri, 25 Mar 2022 08:33:06 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 37FB2D080F for ; Fri, 25 Mar 2022 05:31:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648211491; h=from:from:reply-to:subject:subject: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=yPjA/sNpnOcC3OZqw/MwHjQE8KDwlLZ97r+qgQx76dw=; b=XagkBYa0BJ2I1a/1oVWAo1EYltV/5Ibg85FoVrB97ZzIk/uWt2yUI1aggwUie+L3gijIqE xaPmZHWc/GyUF1YnDNJtQxREkUsgXwz6c8YDiYanr7aSNIVPbil8gNr5+HOIfM6+R5uzG/ hrrj7gxyz7blRDOskZPFbvQ79v6LkQs= Received: from mail-yw1-f199.google.com (mail-yw1-f199.google.com [209.85.128.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-141-Z_2M6U8bOnWvzGc0OdHn4A-1; Fri, 25 Mar 2022 08:31:28 -0400 X-MC-Unique: Z_2M6U8bOnWvzGc0OdHn4A-1 Received: by mail-yw1-f199.google.com with SMTP id 00721157ae682-2e642be1a51so58745347b3.21 for ; Fri, 25 Mar 2022 05:31:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yPjA/sNpnOcC3OZqw/MwHjQE8KDwlLZ97r+qgQx76dw=; b=cxfdW0l67Jh2GJRsTBc1ptVpIYtYdCXILJv+hjOs+V/33aQDDU8m5A/XJcthuggkxR qdqOEN0s31D7F+05eWRPQ0t1Had6dlIyrzBOgX1pSAmOn9BwW95dmK2cXSQrNeE2I3cH pdYZfkzblGgVdXJlQc5pTdsG+HqwbnnVX1O3QtJowWcK9fTY7PPLc/0vi2zFCzImD/2P 9i5Mz2aPTOP0uSvacYLUDiB7OHW1+MAFegVfjHUX4Yxc39TcOaBc6mn40H9FDcXgwFMT okbV9kYWLPa9InnxGD2kj1I18gjCGkOe0QTi1pM5hEd8CrEgC91E/RmITZO++/BHoEvO +sTA== X-Gm-Message-State: AOAM533uYu+XxaaaCi8bHKieNyms9j5KVE1DmOiGVitlCTXseC+b++ch D/6gB7ng8iVK4hZ7sfRkYBDbqkd8EYuW6mDJfUR3VF/7NhwQqjr2An5fOwHeyYh23vkMCLVKBn+ 8+tj1sskSHzEjh+RVhaM8vTCPYjl+lB/SyPHi X-Received: by 2002:a25:22d6:0:b0:633:90f5:a3d with SMTP id i205-20020a2522d6000000b0063390f50a3dmr9732498ybi.402.1648211488034; Fri, 25 Mar 2022 05:31:28 -0700 (PDT) X-Received: by 2002:a25:22d6:0:b0:633:90f5:a3d with SMTP id i205-20020a2522d6000000b0063390f50a3dmr9732460ybi.402.1648211487785; Fri, 25 Mar 2022 05:31:27 -0700 (PDT) MIME-Version: 1.0 References: <20220323201841.4166549-1-tbecker@redhat.com> In-Reply-To: From: Thiago Becker Date: Fri, 25 Mar 2022 09:31:16 -0300 Message-ID: Subject: Re: [PATCH RFC v3 0/6] Intruduce nfsrahead To: Matthew Wilcox Cc: linux-nfs@vger.kernel.org, Steved , trond.myklebust@hammerspace.com, anna.schumaker@netapp.com, Olga Kornievskaia , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Hello, On Wed, Mar 23, 2022 at 6:32 PM Matthew Wilcox wrote: > Which recent changes? Something in NFS or something in the VFS/MM? > Did you even think about asking a wider audience than the NFS mailing > list? I only happened to notice this while I was looking for something > else, otherwise I would never have seen it. The responses from other > people to your patches were right; you're trying to do this all wrong. > > Let's start out with a bug report instead of a solution. What changed > and when? > As Trond stated, c128e575514c ("NFS: Optimise the default readahead size") changed the way readahead is calculated for NFS mounts. This caused some read workloads to underperform, compared to the performance from previous revisions. To recall, the current policy is to adopt the system default readahead of 128kiB, and mounts with sec=krb5p take a performance hit of 50-75% when readahead is 128. I haven't performed an exhaustive search for other workloads that might also be affected, but I noticed the meaningful drop in performance in sec=sys mounts, notes at the end. The previous policy was to calculate the readahead as a multiple of rsize, so we prescribed increasing the value to the complaining part, and this fixed the issue. We are now trying to find a solution that we can incorporate into the system. thiago. ----- Tests ===== RAWHIDE (35% performance hit) ===== # uname -r 5.16.0-0.rc0.20211112git5833291ab6de.12.fc36.x86_64 # grep nfs /proc/self/mountinfo 601 60 0:55 / /mnt rw,relatime shared:332 - nfs4 192.168.122.225:/exports rw,vers=4.2,rsize=262144,wsize=262144,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.122.83,local_lock=none,addr=192.168.122.225 # cat /sys/class/bdi/0\:55/read_ahead_kb 128 # for i in {0..3} ; do dd if=/mnt/testfile.bin of=/dev/null bs=1M 2>&1 | grep copied ; echo 3 > /proc/sys/vm/drop_caches ; done 4294967296 bytes (4.3 GB, 4.0 GiB) copied, 16.5025 s, 260 MB/s 4294967296 bytes (4.3 GB, 4.0 GiB) copied, 16.4474 s, 261 MB/s 4294967296 bytes (4.3 GB, 4.0 GiB) copied, 18.0181 s, 238 MB/s 4294967296 bytes (4.3 GB, 4.0 GiB) copied, 18.2323 s, 236 MB/s # echo 15360 > /sys/class/bdi/0\:55/read_ahead_kb # for i in {0..3} ; do dd if=/mnt/testfile.bin of=/dev/null bs=1M 2>&1 | grep copied ; echo 3 > /proc/sys/vm/drop_caches ; done 4294967296 bytes (4.3 GB, 4.0 GiB) copied, 11.2601 s, 381 MB/s 4294967296 bytes (4.3 GB, 4.0 GiB) copied, 11.1885 s, 384 MB/s 4294967296 bytes (4.3 GB, 4.0 GiB) copied, 11.5877 s, 371 MB/s 4294967296 bytes (4.3 GB, 4.0 GiB) copied, 10.9475 s, 392 MB/s ===== UPSTREAM (30% performance hit) ===== # uname -r 5.17.0+ # grep nfs /proc/self/mountinfo 583 60 0:55 / /mnt rw,relatime shared:302 - nfs4 192.168.122.225:/exports rw,vers=4.2,rsize=262144,wsize=262144,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.122.83,local_lock=none,addr=192.168.122.225 # cat /sys/class/bdi/0\:55/read_ahead_kb 128 # for i in {0..3} ; do dd if=/mnt/testfile.bin of=/dev/null bs=1M 2>&1 | grep copied ; echo 3 > /proc/sys/vm/drop_caches ; done 4294967296 bytes (4.3 GB, 4.0 GiB) copied, 17.056 s, 252 MB/s 4294967296 bytes (4.3 GB, 4.0 GiB) copied, 17.1258 s, 251 MB/s 4294967296 bytes (4.3 GB, 4.0 GiB) copied, 16.5981 s, 259 MB/s 4294967296 bytes (4.3 GB, 4.0 GiB) copied, 16.5487 s, 260 MB/s # echo 15360 > /sys/class/bdi/0\:55/read_ahead_kb # for i in {0..3} ; do dd if=/mnt/testfile.bin of=/dev/null bs=1M 2>&1 | grep copied ; echo 3 > /proc/sys/vm/drop_caches ; done 4294967296 bytes (4.3 GB, 4.0 GiB) copied, 12.3855 s, 347 MB/s 4294967296 bytes (4.3 GB, 4.0 GiB) copied, 11.2528 s, 382 MB/s 4294967296 bytes (4.3 GB, 4.0 GiB) copied, 11.9849 s, 358 MB/s 4294967296 bytes (4.3 GB, 4.0 GiB) copied, 11.2953 s, 380 MB/s