Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp395928pxb; Wed, 3 Feb 2021 08:01:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJzgwsNc5u1z8Yn3MvKIcy7nkvx7nBEvLE+RQ0GrPUOlXbAX7s6lfJ8wV528asTQ59ckUmI4 X-Received: by 2002:a05:6402:3508:: with SMTP id b8mr3679901edd.341.1612368076617; Wed, 03 Feb 2021 08:01:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612368076; cv=none; d=google.com; s=arc-20160816; b=OOfsY0NsWLUIGeKTHRO/kiPSbTfNe1zbnGKapWkZvVHXxbI96fOai9QshXOndjnV3X XC0B/03v2KVk8TmpIt1AYYQlbsqKie1HXSvQLDLe3zchLy+ZwmwHa+XurvoaKsws6ydi zAXEDrDwr5/htWNT3cBeLH2twWRnRcaGSo/ottAHW60RGd7Z37RK9NkMQi62/XPE4sqs ppt0o3jiN68nbLmx0yg3bDQvRE3wGSciPNwIJp/tZ01yB20JePhvAJcwGQlMTjqSwNvW Zf/ISgFbO9jYwq25nlgfAuIL/6/ZWbe0BFM6U/z1TTNIIKTh3k9UMWHyD67ecL4MWHRu 9G2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:mail-followup-to:reply-to:message-id :subject:cc:to:from:date; bh=WvAul6zqL6xEtk8WQntdnwiSj6FOzxlfKiK2uPaNjZk=; b=tR9KL2cIhRa7iUPTqr6V8jSCi/kQfvDcODhDk8aGAzBohr1ssEOLQDV/tVnBQgYgZC 0kVnXE7jGVUXPjJMsk6YfU3AbmVnjwhjKaaq89B+Ebm01YJZamKX4jrp0pXGYcqF983H NzumDIj2BfNCb3w1Zymm8ZtazftV+BJSWBiIiY74FVF6D3LjvHDtLYxc60ap0LoN08C6 RyNrKwVD7af4xG2hVpRySBsTKU+J1+ZuDEOYuoiSQsyq6bjg+uTHunGxTi7viOW+nBGI oIXv5XLozBlJt6tIe372jA4rSC1jrQuvPj6DkZWubY56rmLwu5RYaGeori8QUO2FH8z5 zgBw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y2si1510445eju.432.2021.02.03.08.00.50; Wed, 03 Feb 2021 08:01:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234322AbhBCP76 (ORCPT + 99 others); Wed, 3 Feb 2021 10:59:58 -0500 Received: from mx2.suse.de ([195.135.220.15]:49982 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234717AbhBCP7V (ORCPT ); Wed, 3 Feb 2021 10:59:21 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 31385AC55; Wed, 3 Feb 2021 15:58:39 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 90BD0DA6FC; Wed, 3 Feb 2021 16:56:48 +0100 (CET) Date: Wed, 3 Feb 2021 16:56:48 +0100 From: David Sterba To: ira.weiny@intel.com Cc: clm@fb.com, josef@toxicpanda.com, dsterba@suse.com, Miao Xie , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] fs/btrfs: Fix raid6 qstripe kmap'ing Message-ID: <20210203155648.GE1993@suse.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, ira.weiny@intel.com, clm@fb.com, josef@toxicpanda.com, dsterba@suse.com, Miao Xie , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org References: <20210128061503.1496847-1-ira.weiny@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210128061503.1496847-1-ira.weiny@intel.com> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 27, 2021 at 10:15:03PM -0800, ira.weiny@intel.com wrote: > From: Ira Weiny > > When a qstripe is required an extra page is allocated and mapped. There > were 3 problems. > > 1) There is no reason to map the qstripe page more than 1 time if the > number of bits set in rbio->dbitmap is greater than one. > 2) There is no reason to map the parity page and unmap it each time > through the loop. > 3) There is no corresponding call of kunmap() for the qstripe page. > > The page memory can continue to be reused with a single mapping on each > iteration by raid6_call.gen_syndrome() without remapping. So map the > page for the duration of the loop. > > Similarly, improve the algorithm by mapping the parity page just 1 time. > > Fixes: 5a6ac9eacb49 ("Btrfs, raid56: support parity scrub on raid56") > To: Chris Mason > To: Josef Bacik > To: David Sterba > Cc: Miao Xie > Signed-off-by: Ira Weiny > > --- > This was found while replacing kmap() with kmap_local_page(). After > this patch unwinding all the mappings becomes pretty straight forward. > > I'm not exactly sure I've worded this commit message intelligently. > Please forgive me if there is a better way to word it. Changelog is good, thanks. I've added stable tags as the missing unmap is a potential problem.