Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp743123pxp; Fri, 11 Mar 2022 13:58:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJyfBB9OQonPQ084wF6/MbX/WQY6Lrz2/NOnh0FNgNuM3m7IJ/AosHBeEtSRAtpP7XEn1cKQ X-Received: by 2002:a17:90b:33cb:b0:1bf:844b:44b4 with SMTP id lk11-20020a17090b33cb00b001bf844b44b4mr12907230pjb.153.1647035936332; Fri, 11 Mar 2022 13:58:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647035936; cv=none; d=google.com; s=arc-20160816; b=FUznPj4KjPW6AgmAIjqUuKrtuFp3HycXpuaXI3//qqBNNPcnkV9Rmy5poe8n2jMAXN 9ODnZhvJEKJPBuJowSTI9VkOypB5Jrob6oZYIPwnolval5OYjcxKpFuMDRrCNsi55CIy uHidXhDisU4H57Dl/UBoClaw0coxV66zCUwz2wgFIk+Tk3lTk6UAP7W/WLrrYGhgPlWH 6isBeN3tLBnZzGn+TU2nkDHm2Ld4lZpt6vZQNAQJ6m2ebvkVaBzE6XIDFZ4zd4g8WsZ6 7tCy6FhcXWPIq5R0kFwoZ33YzMajUdrrlnwxMfDetQuSJc+/Wmo03PJZaTdAdCRnvEI8 48oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=5WYkCapJcg41PfIySIH3qxCTv6VznYmg5KiXMXL3IY0=; b=0TA39Crcn5KTPpjXZ55stHVjgGetG7X/U+FwdmlpsK2iatwo9EM5tWndtmy0jfEy0g JiS8Kky4DhYnoE7b931vwo9gIJYLkeTb3pHDgqicdU5SoR25c93D3PkNmeeSek7rMXgx yagxaErcu0hVOBX6Hz3z92FKj5XkRNRDCOSRWwHZbVvloxSVi5OMsJiAVZWQj8O/XP6c ClXECakjaKuNut6T4ErDekMcFRuwWTattfUm5abLEwy/QM7cigB/4+daLoc+HUV4WPpY WLstUGzZZIKqM6eYHxSJtjIZv8BS85Ts4yod6K9Np/V6YPMKr3iG8cI+rEjzxEqk6Dmc hTDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=A76UgdQB; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id l15-20020a056a0016cf00b004e1079907a0si10011831pfc.137.2022.03.11.13.58.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 13:58:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=A76UgdQB; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:18 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 0572327ED81; Fri, 11 Mar 2022 13:15:43 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350245AbiCKTHj (ORCPT + 99 others); Fri, 11 Mar 2022 14:07:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351026AbiCKTHi (ORCPT ); Fri, 11 Mar 2022 14:07:38 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 098DF1AE66C for ; Fri, 11 Mar 2022 11:06:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647025592; 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; bh=5WYkCapJcg41PfIySIH3qxCTv6VznYmg5KiXMXL3IY0=; b=A76UgdQB8ECzSdcWiDY3rnOSDbS3nLDvDQTsPpMeGIiBN1OqXiBGaipDaYPb+g8mQRH55W zbljRo9xY8SjbGau2WeXBEDveFtY6AEzccwWgf0jsoa5l7EEPzNIAK0x4OJ/TDWhK8G9AC mllOu9Iz3oVRn/1pj32waeZgzHDV/90= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-554-VbP5CgP5P2i3pv3mWNNOvw-1; Fri, 11 Mar 2022 14:06:30 -0500 X-MC-Unique: VbP5CgP5P2i3pv3mWNNOvw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 964F41091DA0; Fri, 11 Mar 2022 19:06:29 +0000 (UTC) Received: from nyarly.rlyeh.local (ovpn-116-72.gru2.redhat.com [10.97.116.72]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EC8F660BF4; Fri, 11 Mar 2022 19:06:25 +0000 (UTC) From: Thiago Becker To: linux-nfs@vger.kernel.org Cc: steved@redhat.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com, kolga@netapp.com, Thiago Becker Subject: [RFC v2 PATCH 0/7] Introduce nfs-readahead-udev Date: Fri, 11 Mar 2022 16:06:10 -0300 Message-Id: <20220311190617.3294919-1-tbecker@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Spam-Status: No, score=-2.4 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 Recent changes in the linux kernel caused NFS readahead to default to 128 from the previous default of 15 * rsize. This causes performance penalties to some read-heavy workloads, which can be fixed by tuning the readahead for that given mount. Specifically, the read troughput on a sec=krb5p mount drops by 50-75% when comparing the default readahead with a readahead of 15360. Previous discussions: https://lore.kernel.org/linux-nfs/20210803130717.2890565-1-trbecker@gmail.com/ I attempted to add a non-kernel option to mount.nfs, and it was rejected. https://lore.kernel.org/linux-nfs/20210811171402.947156-1-trbecker@gmail.com/ Attempted to add a mount option to the kernel, rejected as well. I had started a separate tool to set the readahead of BDIs, but the scope is specifically for NFS, so I would like to get the community feeling for having this in nfs-utils. This patch series introduces nfs-readahead-udev, a utility to automatically set NFS readahead when NFS is mounted. The utility is triggered by udev when a new BDI is added, returns to udev the value of the readahead that should be used. The tool currently supports setting read ahead per mountpoint, nfs major version, or by a global default value. Thiago Becker (7): Create nfs-readahead-udev readahead: configure udev readahead: create logging facility readahead: only set readahead for nfs devices. readahead: create the configuration file readahead: add mountpoint and fstype options readahead: documentation .gitignore | 6 + configure.ac | 4 + tools/Makefile.am | 2 +- tools/nfs-readahead-udev/99-nfs_bdi.rules.in | 1 + tools/nfs-readahead-udev/Makefile.am | 26 +++ tools/nfs-readahead-udev/config_parser.c | 25 +++ tools/nfs-readahead-udev/config_parser.h | 14 ++ tools/nfs-readahead-udev/list.h | 48 ++++ tools/nfs-readahead-udev/log.h | 16 ++ tools/nfs-readahead-udev/main.c | 211 ++++++++++++++++++ .../nfs-readahead-udev/nfs-readahead-udev.man | 47 ++++ tools/nfs-readahead-udev/parser.y | 85 +++++++ tools/nfs-readahead-udev/readahead.conf | 15 ++ tools/nfs-readahead-udev/scanner.l | 19 ++ tools/nfs-readahead-udev/syslog.c | 47 ++++ 15 files changed, 565 insertions(+), 1 deletion(-) create mode 100644 tools/nfs-readahead-udev/99-nfs_bdi.rules.in create mode 100644 tools/nfs-readahead-udev/Makefile.am create mode 100644 tools/nfs-readahead-udev/config_parser.c create mode 100644 tools/nfs-readahead-udev/config_parser.h create mode 100644 tools/nfs-readahead-udev/list.h create mode 100644 tools/nfs-readahead-udev/log.h create mode 100644 tools/nfs-readahead-udev/main.c create mode 100644 tools/nfs-readahead-udev/nfs-readahead-udev.man create mode 100644 tools/nfs-readahead-udev/parser.y create mode 100644 tools/nfs-readahead-udev/readahead.conf create mode 100644 tools/nfs-readahead-udev/scanner.l create mode 100644 tools/nfs-readahead-udev/syslog.c -- 2.35.1