Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1958060imm; Tue, 22 May 2018 12:10:11 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo/AOYjS4V5QpizoE8QEwRFVYMDOqcpYl4RTLL+Ni6hMfiZ2coLq2J2cdbT+Mqfm7aTfHMt X-Received: by 2002:a17:902:b492:: with SMTP id y18-v6mr18001432plr.2.1527016211707; Tue, 22 May 2018 12:10:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527016211; cv=none; d=google.com; s=arc-20160816; b=BmmQ7/orDCcgln9MWrxMRw23ZktQWrIU7VLe5D7gm10tvWOvkAul+55wZEmzIemEmu Lr6nfTF8ugVrwe4LWWdaPF0UGzdWjyK7ctjClYLKb0/7sQzGR5db4F+GHddz8zRWa7US +tSbaaOVcLDc0pfu+suumDkzgb725gK8QlOjr/3bkGfpEsnib/499dV2GZ5Oi6wgwd6W xtRx75IG06I/sFLBLgKHKIIA+g3JtvG96eMAdSOxk+/ux6QbO+Fn0Sd349k0y4ZHa5Eh N5aannEMDOXqgXQLnUtSJDUMkf5C0OuK8WZgz9JwoM9U/FZCnFMTMV/y5GlrISLHhho/ 4C0g== 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:cc :to:from:date:arc-authentication-results; bh=Wmi9s1Aki0xJjdcp2GdOSc0Dk1P5Scs5M8po1R/Srig=; b=EDkssYiN3uZyq7jrZMObwfkUBPharEcHnuFLbrZzE+g/mvUIBaOE8fs8ciLguLXLVj OXZE1VW6GYzy8z6lGLGEPdrlFplIs0DpHgnj0S0pKnBaVtAYeAFZoEvSXwztjzs6yI4d Sv7qmtb7lkWxHgzgRl5EBiMsGLyRNwuIERtzBI7ZtS4EBdP0kYpJUAm+7lr5JarMD+B3 LTHFIcibO9os6+9x8kp/qyIQuF5/1YEFksUvmGtVIdzpWXgNGqPHLox37KP6V/0osqHR B0RFucLHWkwb+yiKOeOMpkG3CH9yTmslbQKwoCV/v8Zog7n00RSvfb79gpJs019ge5V6 BLNw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r39-v6si17358626pld.249.2018.05.22.12.09.56; Tue, 22 May 2018 12:10:11 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751985AbeEVTJi (ORCPT + 99 others); Tue, 22 May 2018 15:09:38 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:54140 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751411AbeEVTJg (ORCPT ); Tue, 22 May 2018 15:09:36 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0F346401EF08; Tue, 22 May 2018 19:09:36 +0000 (UTC) Received: from localhost (unknown [10.18.25.149]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B8DFF2166BD6; Tue, 22 May 2018 19:09:34 +0000 (UTC) Date: Tue, 22 May 2018 15:09:34 -0400 From: Mike Snitzer To: Christoph Hellwig Cc: Kent Overstreet , Jens Axboe , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, colyli@suse.de, darrick.wong@oracle.com, clm@fb.com, bacik@fb.com, linux-xfs@vger.kernel.org, drbd-dev@lists.linbit.com, linux-btrfs@vger.kernel.org, linux-raid@vger.kernel.org, neilb@suse.com Subject: Re: [PATCH 00/13] convert block layer to bioset_init()/mempool_init() Message-ID: <20180522190933.GA25904@redhat.com> References: <4b343aef-e11c-73ba-1d88-7e73ca838cad@kernel.dk> <20180521150439.GA19379@redhat.com> <61e30dcf-a01c-f47d-087a-12930caf9aef@kernel.dk> <20180521151817.GA19454@redhat.com> <20180521160907.GA19553@redhat.com> <20180521173724.GG11495@kmo-pixel> <20180521182427.GA20013@redhat.com> <20180521233855.GI11495@kmo-pixel> <20180522064118.GA18704@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180522064118.GA18704@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 22 May 2018 19:09:36 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 22 May 2018 19:09:36 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'msnitzer@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 22 2018 at 2:41am -0400, Christoph Hellwig wrote: > On Mon, May 21, 2018 at 07:38:55PM -0400, Kent Overstreet wrote: > > On Mon, May 21, 2018 at 02:24:32PM -0400, Mike Snitzer wrote: > > > Every single data structure change in this series should be reviewed for > > > unforeseen alignment consequences. Jens seemed to say that is > > > worthwhile. Not sure if he'll do it or we divide it up. If we divide > > > it up a temp topic branch should be published for others to inspect. > > > > > > Could be alignment hasn't been a historic concern for a bunch of the > > > data structures changed in this series.. if so then all we can do is fix > > > up any obvious potential for false sharing. > > > > Honestly, I almost never worry about alignment... the very few times I do care, > > I use __cacheline_aligned_in_smp. > > And that generally is the right stratgey. If Mike really doesn't want > a change we can just open code the kmalloc for the bio set there, the > important point is that we should not keep the old API around for no > good reason. Again, I never said I didn't want these changes. I just thought it worthwhile to mention the potential for alignment quirks arising. Reality is false sharing is quite uncommon. So my concern was/is pretty niche and unlikely to be applicable. That said, I did take the opportunity to look at all the DM structures that were modified. The bio_set and mempool_t structs are so large that they span multiple cachelines as is. So I focused on eliminating unnecessary spanning of cachelines (by non-bio_set and non-mempool_t members) and eliminated most holes in DM structs. This is the result: http://people.redhat.com/msnitzer/dm-4.18-struct-reorg/ Compare before.txt vs after_kent.txt vs after_mike.txt Nothing staggering or special. Just something I'll add once Kent's latest changes land. But, I also eliminated 2 4-byte holes in struct bio_set, Jens please feel free to pick this up (if you think it useful): From: Mike Snitzer Subject: [PATCH] block: eliminate 2 4-byte holes in bio_set structure Signed-off-by: Mike Snitzer --- include/linux/bio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/bio.h b/include/linux/bio.h index 5e472fc..e6fc692 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -735,7 +735,6 @@ static inline void bio_inc_remaining(struct bio *bio) struct bio_set { struct kmem_cache *bio_slab; - unsigned int front_pad; mempool_t bio_pool; mempool_t bvec_pool; @@ -743,6 +742,7 @@ struct bio_set { mempool_t bio_integrity_pool; mempool_t bvec_integrity_pool; #endif + unsigned int front_pad; /* * Deadlock avoidance for stacking block drivers: see comments in