From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D010C43334 for ; Thu, 30 Jun 2022 22:45:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6E2DF8E0002; Thu, 30 Jun 2022 18:45:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6921C8E0001; Thu, 30 Jun 2022 18:45:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5A77C8E0002; Thu, 30 Jun 2022 18:45:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 4BF1E8E0001 for ; Thu, 30 Jun 2022 18:45:57 -0400 (EDT) Received: from smtpin31.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 1239B3567B for ; Thu, 30 Jun 2022 22:45:57 +0000 (UTC) X-FDA: 79636386354.31.B573BAB Received: from gw2.atmark-techno.com (gw2.atmark-techno.com [35.74.137.57]) by imf06.hostedemail.com (Postfix) with ESMTP id 1115E180033 for ; Thu, 30 Jun 2022 22:45:55 +0000 (UTC) Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by gw2.atmark-techno.com (Postfix) with ESMTPS id 8AC7020CFB for ; Fri, 1 Jul 2022 07:45:54 +0900 (JST) Received: by mail-pl1-f197.google.com with SMTP id q8-20020a17090311c800b0016a125c933fso339276plh.4 for ; Thu, 30 Jun 2022 15:45:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=km11n9bibd1DONw/oZcy8niZnRZ3n4v8wZkKOW817eo=; b=MbvdCp+3bNCfaF2aWdYL9K3wi6W9lyUl1tMqkuRwCp3F0jAuccg/NQoe36J8pBAFCa H4Gml/eegNUrwKipHa1gb0wHr/9ukCaMauLfYUqvxGIAUZtdtvvheorfqyKfYMgSCfN2 bJG+wTMQjwgFsZtk2jvAxaHgouGo7Nh9aB2y1fqVCwca+jHs8DNIFG9jAL4JPVwee7je akFSRlvUWqdz03DfvDUSigVelbyPNzYxA+y5Jej2FmU6Ja8FBOm45jJsyWwVsaCWW3SD jrmCO6PsAhqjh/iuhTog8pHOgG8Xlh+2gLkdKqGWn6QCWM+9i4asJ3RzWZjqpCxCDK57 QeLw== X-Gm-Message-State: AJIora9Ul08RQiY81npTz8nHvC0IFj2vM4NRCA6Q0auTC3i8hmYS+VtK kX4UIBzhTLSfwOEqq8/TfUTPX0ACNBwBe1fRED4OPNVus/axZOvoC2XYHW2/Ks8cyHY+YBlzASY +/pJZ9fGAYeU9 X-Received: by 2002:a17:90a:e7c7:b0:1ec:99eb:ff3a with SMTP id kb7-20020a17090ae7c700b001ec99ebff3amr14185465pjb.204.1656629153456; Thu, 30 Jun 2022 15:45:53 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tbEF7rysEj6qq7RxLY0j8faMqmAl6JmAcrnAwXLdvYnDiPLFibeEEek+5kuLiDdUWGgs+lTw== X-Received: by 2002:a17:90a:e7c7:b0:1ec:99eb:ff3a with SMTP id kb7-20020a17090ae7c700b001ec99ebff3amr14185441pjb.204.1656629153168; Thu, 30 Jun 2022 15:45:53 -0700 (PDT) Received: from pc-zest.atmarktech (117.209.187.35.bc.googleusercontent.com. [35.187.209.117]) by smtp.gmail.com with ESMTPSA id s9-20020a62e709000000b00527ab697c6asm8281384pfh.18.2022.06.30.15.45.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Jun 2022 15:45:52 -0700 (PDT) Received: from martinet by pc-zest.atmarktech with local (Exim 4.95) (envelope-from ) id 1o72su-000Ee0-Uy; Fri, 01 Jul 2022 07:43:40 +0900 Date: Fri, 1 Jul 2022 07:43:30 +0900 From: Dominique MARTINET To: Theodore Ts'o Cc: "Matthew Wilcox (Oracle)" , linux-btrfs@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Yu Kuai , Kent Overstreet Subject: Re: Major btrfs fiemap slowdown on file with many extents once in cache (RCU stalls?) (Was: [PATCH 1/3] filemap: Correct the conditions for marking a folio as accessed) Message-ID: References: <20220619151143.1054746-1-willy@infradead.org> <20220619151143.1054746-2-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656629156; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=km11n9bibd1DONw/oZcy8niZnRZ3n4v8wZkKOW817eo=; b=oLCobq9xeeo7nhFX5CPwSxt/swGvrTl4dvx1vPcrXTM/sIyw1xMkJ9nK3b2eUTCpwh1o4Q RmaxXp9KT2W8HyUGC/sRzuAw/H/NGE7dLeC25L5uklfZV4S0ZPCuM1IZUzipH/spjAiHn6 pk9S/qdTVh/1MG+f97J55Nb2YqNNYFk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656629156; a=rsa-sha256; cv=none; b=fjJMJkAD5gzyYtXoq2Uyo5mFEYyLYdPKZg1ki3JLXcPOSjeSNr+odRmTUzDYyF5hW/5t49 lscTOsp1E+C6wb8lKyd1QGJU+SxLugJ2BtdtlDjBcD0uOC90ZaZikOHmxG9sZ8oUElyQ61 opIkxHJMCG5AhU0b9dKKbqpBUj+yeyc= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=none; spf=pass (imf06.hostedemail.com: domain of dominique.martinet@atmark-techno.com designates 35.74.137.57 as permitted sender) smtp.mailfrom=dominique.martinet@atmark-techno.com; dmarc=none Authentication-Results: imf06.hostedemail.com; dkim=none; spf=pass (imf06.hostedemail.com: domain of dominique.martinet@atmark-techno.com designates 35.74.137.57 as permitted sender) smtp.mailfrom=dominique.martinet@atmark-techno.com; dmarc=none X-Rspamd-Server: rspam03 X-Rspam-User: X-Stat-Signature: f9b8sf1168uiqoqksb8ubx3up6hkf8n3 X-Rspamd-Queue-Id: 1115E180033 X-HE-Tag: 1656629155-609593 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000385, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Theodore Ts'o wrote on Thu, Jun 30, 2022 at 10:37:58AM -0400: > On Thu, Jun 30, 2022 at 04:29:05PM +0900, Dominique MARTINET wrote: > > Hi Willy, linux-btrfs@vger, > > > > Matthew Wilcox (Oracle) wrote on Sun, Jun 19, 2022 at 04:11:41PM +0100: > > > We had an off-by-one error which meant that we never marked the first page > > > in a read as accessed. This was visible as a slowdown when re-reading > > > a file as pages were being evicted from cache too soon. In reviewing > > > this code, we noticed a second bug where a multi-page folio would be > > > marked as accessed multiple times when doing reads that were less than > > > the size of the folio. > > > > when debugging an unrelated issue (short reads on btrfs with io_uring > > and O_DIRECT[1]), I noticed that my horrible big file copy speeds fell > > down from ~2GB/s (there's compression and lots of zeroes) to ~100MB/s > > the second time I was copying it with cp. > > > > I've taken a moment to bisect this and came down to this patch. > > I think you may have forgotten to include the commit-id that was the > results of your bisect.... ? Sorry, this is the patch I replied to and it was recent enough that I assumed it'd still be in mailboxes, but you're right it's better with a commit id. This is was merged as 5ccc944dce3d ("filemap: Correct the conditions for marking a folio as accessed") Thanks, -- Dominique