Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1521199pxf; Fri, 12 Mar 2021 11:30:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFlRQ4BBVRIGhk70gG1ZQtNKFZ7iFYsOwaO4OsA8SPzztdap4WbgUY265rEqqJREws6stz X-Received: by 2002:a17:907:2716:: with SMTP id w22mr10342362ejk.328.1615577420582; Fri, 12 Mar 2021 11:30:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615577420; cv=none; d=google.com; s=arc-20160816; b=hQdVAoLMzZ9OeOlA4HW32S/Xrz2drPfDau2QfmyC474vGzTgKAa9q8gBUXI/P834q+ K3X/iQQfQ7c+9CXXxPz0GkeLlSzVZ9RSi9IoiVj785JgDJ6PkeDYlsbLGNhUaAx0c7vI dFL0Wjb8I58TcfPXExP1I3ZAQJynNyI0KfFbmBQg1tOBMKnTJpskoRtoou+A5/przVcH mpBo1oTcWiVGiHxaRFso90fcvr7ksPfxdHTKTZEdCs64JtpXlkg/pvYP03UAMfbXcn8E qn29wHuBbJSRaHE1ofxgWR9gKTf3ocZ/sENgmnsqbhIxAO7ONOYdKXX2Ta7tyTgisUDU vpDA== 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=FsKUHrgSHmBBmvy2ZmBgIxfKBOXNAqgZABgqN6r3R2M=; b=OT1zmExkOPfko8n9j7+lQKIaD7Ls+z9xWIirG60miBG8Znib7l14n3RTKqPlPMlL/K V3SxX6f10OUVJ+N2NWWJ22yAXEDt5DcgE1BSkgg1tPJDZ4UtL4m/fbAl4DE11bgXY41L NSu8tlxqoou9T6GezGaAwZmJ3i9t4W5Ioc40Omok9CDG8U8pXXViaYzBxMRR+GO5rl92 Q1P/sM4B60j9NMsKuAverc4tgwdo4IYlo/oOptXXQL9Dqr9XrmDZ+SoFiStERj5nJQ1T qHjkt6Scqpr2HXkeSipgAkJxy6OON5MjjnehexDEIXbLZUySc4akQMpxf/4jrcYBN33i 8Vcw== 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 x26si4761080ejj.525.2021.03.12.11.29.57; Fri, 12 Mar 2021 11:30:20 -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 S233940AbhCLT26 (ORCPT + 99 others); Fri, 12 Mar 2021 14:28:58 -0500 Received: from mx2.suse.de ([195.135.220.15]:59680 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233395AbhCLT2f (ORCPT ); Fri, 12 Mar 2021 14:28:35 -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 1E268AF4D; Fri, 12 Mar 2021 19:28:34 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 4D393DA81D; Fri, 12 Mar 2021 20:26:34 +0100 (CET) Date: Fri, 12 Mar 2021 20:26:34 +0100 From: David Sterba To: ira.weiny@intel.com Cc: Chris Mason , Josef Bacik , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 2/4] fs/btrfs: Convert raid5/6 kmaps to kmap_local_page() Message-ID: <20210312192634.GS7604@suse.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, ira.weiny@intel.com, Chris Mason , Josef Bacik , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org References: <20210217024826.3466046-1-ira.weiny@intel.com> <20210217024826.3466046-3-ira.weiny@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210217024826.3466046-3-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 Tue, Feb 16, 2021 at 06:48:24PM -0800, ira.weiny@intel.com wrote: > From: Ira Weiny > > These kmaps are thread local and don't need to be atomic. So they can use > the more efficient kmap_local_page(). However, the mapping of pages in > the stripes and the additional parity and qstripe pages are a bit > trickier because the unmapping must occur in the opposite order from the > mapping. Furthermore, the pointer array in __raid_recover_end_io() may > get reordered. > > Convert these calls to kmap_local_page() taking care to reverse the > unmappings of any page arrays as well as being careful with the mappings > of any special pages such as the parity and qstripe pages. Though there's one more allocation for the additional array, I don't see a simpler way to avoid it and track the array reordering at a lower memory cost. At least it's not in a performance critical code and the array size is reasonably small.