Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp417450imm; Mon, 21 May 2018 08:05:30 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoHRS093laAdfbQlKZZ073hbKRRVjxRCDYYVA+fbxd4EVFnS1yBOzPa5+ZJoRp+9XFTxIpj X-Received: by 2002:a62:415d:: with SMTP id o90-v6mr20571824pfa.140.1526915130275; Mon, 21 May 2018 08:05:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526915130; cv=none; d=google.com; s=arc-20160816; b=eif86ZI6cINmNfY+m3m8i3rIXo2I1gSktWqeCcRzS6xfBSMw9fa6Gv7hb9Dx+PhShN jbRmxCRKuNtePsg/ctH6FRne8CY+8fV1cm8O9KEaTySCx83EMNaxXgT+KBOpV43FbmGn 7jpoDAsZPT5kJPV48jU4QLEpCf/ctw09ibbn3AhllhgBfbNyFMoZ2cuk0IDhIXy4GnUd BhhVJrl5HGF35Kjz7mhRP+Vl+sUZTr1qi4Ad+lMTayY+gftoNw25jfEd6NSOMwoEJbkW IegGL9gsGzrMX3vi0ox0VHm6kJ9m7TOWeF3wLAXRXVaXH7Y1C2I5iVo+f3NXHyLCcHmm Zgjg== 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=IFKeFo6cSOHwWOy4vo+VAM7ByWk/rzUAzUaJuaGca/Y=; b=VeV0a0gCmDtN0kuFqLkSLF+qKGJA+um3OkTCWc1GS8Zhd2n+U19Dpxd69RR9bSun0o oeR+oOb/cI2amYvuibLQlss3omBLrB/J6EN66hqldbYy1PVtKWjXjXqLh4e7fpcX/sPe PJ2n144ulFu25N5oWLNvSumFDDvXFFkgAmt2UFHhQxCnADujwZ2vH/PcyVv90fDhnpnV RbYO07aL92d+PBInONmn1m/ftU7BhCfvwpPmV9p2h/HaxyQoX7nVRaeRPHtMER5dUiPJ 0C5rrUlma6y8fvKQg5m3FJDcweWlqkkNHvNYsKOMysBzJpLv80AKY3hDZkt/W5uPAJpn aLuQ== 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 i62-v6si14459443pfg.218.2018.05.21.08.05.15; Mon, 21 May 2018 08:05:30 -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 S1753054AbeEUPEr (ORCPT + 99 others); Mon, 21 May 2018 11:04:47 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:51338 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753015AbeEUPEl (ORCPT ); Mon, 21 May 2018 11:04:41 -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 B366F81FE15F; Mon, 21 May 2018 15:04:40 +0000 (UTC) Received: from localhost (unknown [10.18.25.149]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8C3E42166BAD; Mon, 21 May 2018 15:04:40 +0000 (UTC) Date: Mon, 21 May 2018 11:04:40 -0400 From: Mike Snitzer To: Jens Axboe Cc: Kent Overstreet , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, hch@infradead.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: <20180521150439.GA19379@redhat.com> References: <20180520222558.7053-1-kent.overstreet@gmail.com> <20180521140348.GA19069@redhat.com> <686d7df6-c7d1-48a6-b7ff-48dc8aff6a62@kernel.dk> <20180521143132.GB19194@redhat.com> <2bbeeb1a-8b99-b06a-eb9b-eb8523c16460@kernel.dk> <20180521144703.GA19303@redhat.com> <4b343aef-e11c-73ba-1d88-7e73ca838cad@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4b343aef-e11c-73ba-1d88-7e73ca838cad@kernel.dk> 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.8]); Mon, 21 May 2018 15:04:40 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Mon, 21 May 2018 15:04:40 +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 Mon, May 21 2018 at 10:52am -0400, Jens Axboe wrote: > On 5/21/18 8:47 AM, Mike Snitzer wrote: > > On Mon, May 21 2018 at 10:36am -0400, > > Jens Axboe wrote: > > > >> On 5/21/18 8:31 AM, Mike Snitzer wrote: > >>> On Mon, May 21 2018 at 10:19am -0400, > >>> Jens Axboe wrote: > >>> > >>>> On 5/21/18 8:03 AM, Mike Snitzer wrote: > >>>>> On Sun, May 20 2018 at 6:25pm -0400, > >>>>> Kent Overstreet wrote: > >>>>> > >>>>>> Jens - this series does the rest of the conversions that Christoph wanted, and > >>>>>> drops bioset_create(). > >>>>>> > >>>>>> Only lightly tested, but the changes are pretty mechanical. Based on your > >>>>>> for-next tree. > >>>>> > >>>>> By switching 'mempool_t *' to 'mempool_t' and 'bio_set *' to 'bio_set' > >>>>> you've altered the alignment of members in data structures. So I'll > >>>>> need to audit all the data structures you've modified in DM. > >>>>> > >>>>> Could we get the backstory on _why_ you're making this change? > >>>>> Would go a long way to helping me appreciate why this is a good use of > >>>>> anyone's time. > >>>> > >>>> Yeah, it's in the first series, it gets rid of a pointer indirection. > >>> > >>> "Allows mempools to be embedded in other structs, getting rid of a > >>> pointer indirection from allocation fastpaths." > >>> > >>> So this is about using contiguous memory or avoiding partial allocation > >>> failure? Or both? > >>> > >>> Or more to it? Just trying to fully appreciate the theory behind the > >>> perceived associated benefit. > >> > >> It's about avoiding a pointer indirection. Instead of having to > >> follow a pointer to get to that struct, it's simple offset math off > >> your main structure. > >> > >>> I do think the increased risk of these embedded bio_set and mempool_t > >>> themselves crossing cachelines, or struct members that follow them doing > >>> so, really detracts from these types of changes. > >> > >> Definitely something to look out for, though most of them should be > >> per-dev structures and not in-flight structures. That makes it a bit > >> less sensitive. But can't hurt to audit the layouts and adjust if > >> necessary. This is why it's posted for review :-) > > > > This isn't something that is easily caught upfront. Yes we can all be > > busy little beavers with pahole to audit alignment. But chances are > > most people won't do it. > > > > Reality is there is potential for a regression due to false sharing to > > creep in if a hot struct member suddenly starts straddling a cacheline. > > That type of NUMA performance killer is pretty insidious and somewhat > > tedious to hunt down even when looking for it with specialized tools: > > https://joemario.github.io/blog/2016/09/01/c2c-blog/ > > IMHO you're making a big deal out of something that should not be. I raised an issue that had seemingly not been considered at all. Not making a big deal. Raising it for others' benefit. > If the dm bits are that sensitive and cache line honed to perfection > already due to previous regressions in that area, then it might > not be a bad idea to have some compile checks for false cacheline > sharing between sensitive members, or spilling of a sub-struct > into multiple cachelines. > > It's not like this was pushed behind your back. It's posted for > review. It's quite possible the net change is a win for dm. Let's > focus on getting it reviewed, rather than pontificate on what > could potentially go all wrong with this. Why are you making this personal? Or purely about DM? I'm merely pointing out this change isn't something that can be given a quick blanket "looks good". Mike