Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp403309imm; Mon, 21 May 2018 07:53:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqYbKO51BtQ1BhKelfAsaN3VcG87ceO3PCLRVnXmqmPq3V2bZ/W9bsZOsQB6kEOX+MaXVoU X-Received: by 2002:a63:7e13:: with SMTP id z19-v6mr4344024pgc.205.1526914416694; Mon, 21 May 2018 07:53:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526914416; cv=none; d=google.com; s=arc-20160816; b=rBzvNepbHdOVod5EhwkRMo+al1UYIf6/HzjgZW2ix5S838JWnn23Q+BY9naxxhKoSa VKrVEzgNRsZ0tgC5sga595H2ywc0C4cZ3zAy03b1ae73mzNgPLqBvF/gWMAOVwlfTpv1 iKyHkPA4IJPqjaG0qLAzYlNL4SLtUJ6ql1c1nYvuI5R7sAY1Y9QXoGRKj/nO5GXqCbT1 A/PDctq42UvWVGF0arqOFGxosIcI29gR9O5pkIRyfNsTzmoynPWDErBVGqiAr5h6B/k7 v9ZTGPPm4DtZcfEQ6StODGVV2DwXuk0iG3LeE7Ycj2x8T0MpM2owqF/oVQ93CaUY62qf XrcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=xR6UpdZ7lNat0j/ht45fHBCWy5IEAKPBn28YRhPt+9A=; b=sPkia43/L5OsGTwEV84nScUEtS/SWeGExa2BW7dgv43PiSIfvRnWwS/jE8VohSy6hD g4dGySsQ3+xLHXC+cqcXi9hlYR/Gna0+r/x45nUcsH1ZylBBrdlYWAHXzJvejpIgXEE0 D5b4WfIAFsurDOagOR4tquYpeLhYmMveNREaBrKYf6arjFTvOFGFq2gvSOswoWLp6QPH pXT62X6CkN4AB3SJbHTvzOd8FvjECpz/v7q3LLJeqEaYjM4xgl84sY57iFPw9L+0Chuc kKFyJG0j9NEMc23jQnO4mZTm69MAlIXMGSH8IeaPnLXZMe67ehvWpXyGwzFL/dU6ii2h CPqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=tIGOyK/8; 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 j3-v6si14035656pld.300.2018.05.21.07.53.22; Mon, 21 May 2018 07:53:36 -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=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=tIGOyK/8; 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 S1752858AbeEUOwQ (ORCPT + 99 others); Mon, 21 May 2018 10:52:16 -0400 Received: from mail-io0-f193.google.com ([209.85.223.193]:43609 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752566AbeEUOwN (ORCPT ); Mon, 21 May 2018 10:52:13 -0400 Received: by mail-io0-f193.google.com with SMTP id t23-v6so14623170ioc.10 for ; Mon, 21 May 2018 07:52:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=xR6UpdZ7lNat0j/ht45fHBCWy5IEAKPBn28YRhPt+9A=; b=tIGOyK/8BNJWBoq2aZSBKSfBT60e+4WPr9j6r1liWSapO/KPn6RjNe/F0wu7JfLSvq knj1ppv0x3wvrQFkkEF1pwfaYnpRBimfBOwt4Va2i86IjS8GS9kMcdKroA0hc6aiAIcq JB7jw0oPz+n18JBZNyih5wr9URdOx5yjngv9VLvG9LqAf2naP9gPKH7abx1Yn4i9RoEc oCim5MX4F2BnAo9gz7X7gAJU31dcSlMkyk82BbkQNXqS87MpiQfueU3M9JX9mX8utiiD isXeUYDUWrfPESy9s+ZZCyhuPOWlR12t80uNN3INOHh/Ql27AmpJJWhc5ZCTHuylhFjf uLbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=xR6UpdZ7lNat0j/ht45fHBCWy5IEAKPBn28YRhPt+9A=; b=YUZY9s0b56hRFSz+0876ptaExf4kgELH2Jn04n5KT2kDJFes2kuq6hikVXleiKOIJJ 2mF0HV0jyoI4rd+Nm4f7W11H/Cvbj1ur0mD8r7mM7NcgIiWDMx0ZKGRa++9DUBigimmc Ksfn1SYf3j2YEvWn/xsKGQd4mAQZ1WpU9twGsxT8rRTlOMIPFBgWl9irCXCXQ31wfIhd Ky+69qWmBg9du+hcQBvkuJYgyDP7fBFU4oGmA5hkVrkC/xblzzQE9QNXxEPTR8THIzMU MMINzXaG7lDHkaV6TSWIcynTB0eL9IFIGq/QioFok0+CIC7TOtGRifk1r/lX3laJbcK3 JfqA== X-Gm-Message-State: ALKqPwebOKs2fqNMk4DxzuEjOHsHiiBXP4v7id87rpVo+J8LIVSAPXmG Qze5ZWuqawjm9WCGgJzqZTsUww== X-Received: by 2002:a6b:307:: with SMTP id 7-v6mr23477703iod.66.1526914333052; Mon, 21 May 2018 07:52:13 -0700 (PDT) Received: from [192.168.1.167] ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id y2-v6sm8331493ita.31.2018.05.21.07.52.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 May 2018 07:52:11 -0700 (PDT) Subject: Re: [PATCH 00/13] convert block layer to bioset_init()/mempool_init() To: Mike Snitzer 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 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> From: Jens Axboe Message-ID: <4b343aef-e11c-73ba-1d88-7e73ca838cad@kernel.dk> Date: Mon, 21 May 2018 08:52:10 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20180521144703.GA19303@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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. -- Jens Axboe