Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3458997ybl; Mon, 19 Aug 2019 19:33:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqxxjcc1mL+pDzuEsGXRykUFepKriC8uEwrvv+7N9+xHvCvpiUj2U+CjI7rzATKVbRaK2HCj X-Received: by 2002:a17:90a:feb:: with SMTP id 98mr22601042pjz.55.1566268386322; Mon, 19 Aug 2019 19:33:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566268386; cv=none; d=google.com; s=arc-20160816; b=U54xP6iSWpEt18WF6/V/9wiiHndQrQmKmUxfn2Kqe53h7Dk2JTz0NgwDxxNvNl8Xfq elLErVY6vPd/GFCfUmIsMyXyXYRGNyZZHPBNmwT+CI3MJ4rdxrcxApUqh2pYo0P0rxLr RtvS1F9EvSCrJ6BGQSRvpFo6QSOT6br/s+QA1kV6Rog0f1SgUn5ffP0RBWTNUiCs6cdy uJbtMUaKQ6DTBhPE4j2F+RpnyyLjJS167w+0qFOE88SGc09v00RN6yNLRqKgZn0pjsNS zk9FTcnx+x0ZSKc45WfSIPYJ0cjcsiJYjgURajeySd6QlMebOnCLemH7iztTWTbaIwcq RDJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:to :from:date:dkim-signature; bh=uPXPHVEYMLe1+2GVdYIOdPqr5CMV8EsylIRmKkmRT3Q=; b=xEHEtSM3mYQ4/TF3qCiAPQFOAatniCgdgpXur7yDH/sxPrF14ViU+pk7f/nyZAiN4N 0uSwegdEGjEcJsMtaD2iqlk3Kdz1cUIslbjDTSj/YhWCNHpOj5ZwTdsoV2pZCN53zmxa 7BvBfJLeAo63hVTGA3CC2syIMljIqTI+cNQDxqpi5VwgWqLNDAz9eH0G9uLcpf27/1od i8F5NKa99ljlM4nAnLYfqZoLdV8hKSBSGDhE/V0EJ+e2v0PPY433Sxr8BVetAx2+ZtFJ vlcRq/YZDB6P0nZV3xH1KC4ipZN9126tQTCg9qKRlDZY5If4glNL7j9twVi9iSvwq8tP W51Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=mH0VY+ov; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g9si10101053pjv.37.2019.08.19.19.32.51; Mon, 19 Aug 2019 19:33:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=mH0VY+ov; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729107AbfHTCar (ORCPT + 99 others); Mon, 19 Aug 2019 22:30:47 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:56210 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728734AbfHTCar (ORCPT ); Mon, 19 Aug 2019 22:30:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:To:From:Date:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=uPXPHVEYMLe1+2GVdYIOdPqr5CMV8EsylIRmKkmRT3Q=; b=mH0VY+ovyP9mQQyeA2pygVd+6 jlgtHzACKYGkOPyDVHPZ1PjKaSFzvetqdR5EDtZcKQm5AZEUs7VM7R3dfG5jl0z5n+Ie4leAPKsGJ u/vM7LKI6mT/GNbP7XvILp+P6nx6S71Mv/CoaZ8idyC8hOQQZ3gwCUl+ZL/B2nzffjhxYzGyJWJNx KkcWSK7fwws93Q69B/L7lCriRIvh7VSGlJDyi2G4DHiyHNQM5dJK2HV73vxCCrwNwGaSZCu3Wc5P1 McDsO+eyJSOiseL+x6zSQ+MN5Ix3KK3HW8EocfpujB8ickMfRLColHq2KFtkfRL3/UjGP4IDHSW+j s8IxFRwEg==; Received: from hch by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hztup-0001lf-QO; Tue, 20 Aug 2019 02:30:31 +0000 Date: Mon, 19 Aug 2019 19:30:31 -0700 From: Christoph Hellwig To: dsterba@suse.cz, Christophe Leroy , erhard_f@mailbox.org, Chris Mason , Josef Bacik , David Sterba , Andrew Morton , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-btrfs@vger.kernel.org, linux-mm@kvack.org, stable@vger.kernel.org Subject: Re: [PATCH] btrfs: fix allocation of bitmap pages. Message-ID: <20190820023031.GC9594@infradead.org> References: <20190817074439.84C6C1056A3@localhost.localdomain> <20190819174600.GN24086@twin.jikos.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190819174600.GN24086@twin.jikos.cz> User-Agent: Mutt/1.11.4 (2019-03-13) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 19, 2019 at 07:46:00PM +0200, David Sterba wrote: > Another thing that is lost is the slub debugging support for all > architectures, because get_zeroed_pages lacking the red zones and sanity > checks. > > I find working with raw pages in this code a bit inconsistent with the > rest of btrfs code, but that's rather minor compared to the above. > > Summing it up, I think that the proper fix should go to copy_page > implementation on architectures that require it or make it clear what > are the copy_page constraints. The whole point of copy_page is to copy exactly one page and it makes sense to assume that is aligned. A sane memcpy would use the same underlying primitives as well after checking they fit. So I think the prime issue here is btrfs' use of copy_page instead of memcpy. The secondary issue is slub fucking up alignments for no good reason. We just got bitten by that crap again in XFS as well :(