Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1558134rwi; Thu, 13 Oct 2022 15:54:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7L7uwqeoznGGk39lKs9dvw8AFoCE44NztPiVsAQATxw4nsRhpUh8onUmhWnmatjYS5mTI4 X-Received: by 2002:a17:902:ab89:b0:17a:67c:b9e9 with SMTP id f9-20020a170902ab8900b0017a067cb9e9mr2153511plr.55.1665701670162; Thu, 13 Oct 2022 15:54:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665701670; cv=none; d=google.com; s=arc-20160816; b=oBeJc6h+MvCEWnk+Ie9IYJ3FEQ+wvnAnTl+YDLiL3/C2KIeb+RVp9DSPVhMJvCdyGX 3Mgzsay2br3YEIrVxVMctDV7u1yC6SIm0kTrWeXXsqz2XGRj2+NsSrWmL0nukNaVIW5a gQgy31gB1c5W5PlWdbW8UoKRlHbckStJuta3p6CMj4zWvRf/3d8hSOYIukudanqo/0ys phglavqVMdjMmoeohnPDWuYnlUIbf7g97XJIxxZA9R5IL9Df4MzV91RiNsWI37Lvn1d3 MHai8qBNTUyl7/iNWz0carm7RjU/ddeOX0QuneyPcVRwQXG6m5kKp8M6aj2gEJDuYEHH rzIg== 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=uV9jv29H6aFjQ0ZSoY1eBV2TaHPRxfvEQYTsQ4HbTmo=; b=TdRvVZTRHMGexqRvbrnpVdKPYWH3zrPGEF7u9sQhSfjdfYzgsPZwWelocPPxy2WaXu mR+4FLqorhbGUW6Ku95cB1D6jMiND/ulgMG3GMlJsrFu/PXDsyvoS3jR0ChFDPe3waDv mk+KhLXLNqCbR7YYbbRqqKdwZhoj8dOsTCDw0JmPSY4vA1CC8iTIVR9pJVFRwkmvD7gz sFy22PDuc/NIE6A67VRvNEchM1MIvuJ8a8ZaM9gYXGC/Ps5zDIqOZoofkt2XoCPu6WGt mCWH8QF2vhUDzoQnmYO7cFHskgI/jvaJsnFRjoRwgbMkDi1oNR45TVP70+WRuY5gzBno nr1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@comcastmailservice.net header.s=20211018a header.b=pkixH37i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w12-20020a63fb4c000000b0043541f027e0si694806pgj.877.2022.10.13.15.54.16; Thu, 13 Oct 2022 15:54:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@comcastmailservice.net header.s=20211018a header.b=pkixH37i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229766AbiJMWpH (ORCPT + 99 others); Thu, 13 Oct 2022 18:45:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229771AbiJMWpE (ORCPT ); Thu, 13 Oct 2022 18:45:04 -0400 Received: from resqmta-c1p-023465.sys.comcast.net (resqmta-c1p-023465.sys.comcast.net [IPv6:2001:558:fd00:56::5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B46755F234 for ; Thu, 13 Oct 2022 15:44:56 -0700 (PDT) Received: from resomta-c1p-023267.sys.comcast.net ([96.102.18.232]) by resqmta-c1p-023465.sys.comcast.net with ESMTP id j2WSoDUqzf0y0j6uGoIgBW; Thu, 13 Oct 2022 22:42:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcastmailservice.net; s=20211018a; t=1665700944; bh=uV9jv29H6aFjQ0ZSoY1eBV2TaHPRxfvEQYTsQ4HbTmo=; h=Received:Received:From:To:Subject:Date:Message-Id:MIME-Version; b=pkixH37in8eAtc+ANM7ONsju8O0nl69xc2fbW3o9jM11zq3Z4fkA0wCOI59y1/RCl Hpzt8pT/j8XmFzjczzffsJuYoiHEVK4gI3mMJ64PS1rkHq1mQ7WLlb0Jq8XfqcuWDB eMKgePlLoZP+aPHhm7Z7pW/IMg0oo4BKcP2bqGh3V8xbPwqQMmVBNltvrIUWeik2mU Wf9zXB1kEkRmtl5YdVH0qLGIbwSdV/aEjH4bDCLl/aMNV9u4pploA3xOd0WhDegXeU xna7IeSPPhE5P2rQd6e/N0o+gw5F/aWYPndf9oJk8dmmcfb9xGWcL7DWrMFYVr+DgX krdoBC0fbd4gw== Received: from jderrick-mobl4.amr.corp.intel.com ([71.205.181.50]) by resomta-c1p-023267.sys.comcast.net with ESMTPA id j6toofOVmA6uYj6ttozg6o; Thu, 13 Oct 2022 22:42:02 +0000 X-Xfinity-VAAS: gggruggvucftvghtrhhoucdtuddrgedvfedrfeekuddgudefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuvehomhgtrghsthdqtfgvshhipdfqfgfvpdfpqffurfetoffkrfenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkofgggfestdekredtredttdenucfhrhhomheplfhonhgrthhhrghnucffvghrrhhitghkuceojhhonhgrthhhrghnrdguvghrrhhitghksehlihhnuhigrdguvghvqeenucggtffrrghtthgvrhhnpedvtdejiefgueelteevudevhfdvjedvhfdtgfehjeeitdevueektdegtedttdehvdenucfkphepjedurddvtdehrddukedurdehtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhephhgvlhhopehjuggvrhhrihgtkhdqmhhosghlgedrrghmrhdrtghorhhprdhinhhtvghlrdgtohhmpdhinhgvthepjedurddvtdehrddukedurdehtddpmhgrihhlfhhrohhmpehjohhnrghthhgrnhdruggvrhhrihgtkheslhhinhhugidruggvvhdpnhgspghrtghpthhtohepjedprhgtphhtthhopehsohhngheskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqrhgrihgusehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepjhhonhgrthhhrghnrdguvghrrhhitghksehsoh hlihguihhgmhdrtghomhdprhgtphhtthhopehjohhnrghthhgrnhigrdhskhdruggvrhhrihgtkhesihhnthgvlhdrtghomhdprhgtphhtthhopehmrghrihhushiirdhtkhgrtgiihihksehlihhnuhigrdhinhhtvghlrdgtohhmpdhrtghpthhtohepjhhonhgrthhhrghnrdguvghrrhhitghksehlihhnuhigrdguvghv X-Xfinity-VMeta: sc=-100.00;st=legit From: Jonathan Derrick To: Song Liu Cc: , , jonathan.derrick@solidigm.com, jonathanx.sk.derrick@intel.com, Mariusz Tkaczyk , Jonathan Derrick Subject: [PATCH v2 0/3] Bitmap percentage flushing Date: Thu, 13 Oct 2022 16:41:48 -0600 Message-Id: <20221013224151.300-1-jonathan.derrick@linux.dev> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no 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-kernel@vger.kernel.org This introduces a percentage-flushing mechanism that works in-tandem to the mdadm delay timer. The percentage argument is based on the number of chunks dirty (rather than percentage), due to large drives requiring smaller and smaller percentages (eg, 32TB drives-> 1% is 320GB). This set hopes to provide a way to make the bitmap flushing more consistent. It was observed that a synchronous, random write qd1 workload, could make bitmap writes easily become almost half of the I/O. And in similar workloads with different timing, it was several minutes between bitmap updates. This is too inconsistent to be reliable. This first and second patches adds the flush_threshold parameter. The default value of 0 defines the default behavior: unplugging immediately just as before. With a flush-threshold value of 1, it becomes more consistent and paranoid, flushing on nearly every I/O, leading to a 40% or greater situation. From there, the flush_threshold can be defined higher for those situations where power loss is rare and full resync can be tolerated. The third patch converts the daemon worker to an actual timer. This makes it more consistent and removes some ugly code. Jonathan Derrick (3): md/bitmap: Add chunk-threshold unplugging md/bitmap: Add sysfs interface for flush threshold md/bitmap: Convert daemon_work to proper timer Documentation/admin-guide/md.rst | 5 ++ drivers/md/md-bitmap.c | 98 +++++++++++++++++++++++++------- drivers/md/md-bitmap.h | 4 +- drivers/md/md.c | 9 ++- drivers/md/md.h | 2 + 5 files changed, 93 insertions(+), 25 deletions(-) -- 2.31.1