Received: by 10.213.65.68 with SMTP id h4csp1297020imn; Thu, 29 Mar 2018 01:57:42 -0700 (PDT) X-Google-Smtp-Source: AIpwx49yymUxUw65DG56TwSOYVWpdVMyw0wbe+hLtlOQpphPhZ30lLLTtlOC1WMXSM7J3PmFxk2E X-Received: by 10.167.131.135 with SMTP id u7mr5677537pfm.50.1522313862091; Thu, 29 Mar 2018 01:57:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522313862; cv=none; d=google.com; s=arc-20160816; b=mERY1xdv++Izie78piIpOS6G1UyxMOL7Zk6Ml5BdiuSdd8oKxaY9XoYDHyZJ0Boa9y ba3U81PFfIyJRehPLiUUpBM53Ug+SfJLhJ3g96fjGGv2Dbz2byIQ9MxNPWhUbOkwRvOq lMHMklIl3pZHnkNFWH05pn06bpijC0YmMaqRrO6k/BMQpBS6KM9IEylsyd2Qj9gFp5fE rvXnYqoSG8DPtcDkKXmSo++abr+/5cZTkKoUW5tB4+LzoZj5h223AU/R6EgI+EFfpamE QmW+O/0py6bvclsSJqARQahVGZhxEnfRv5K7mbAZR6d8VkJiN0//T4zTc8+DMCEdhdLG 6kAw== 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=CEIt1HZ68kZGyxxn2R2vlSmlCFe4cR5M7Ov9VvkbbJI=; b=QQ6vBFsQN07QY85y0XLCKnkd3D7gcoOSYiJMnaEBoFFrmpTjSFbyivQuwOrynmN1+g CYdw+idu4yNxJiRZJQeO6z8EGbpekRCT46H/idkaGkDINspDeU7pz/Dq184RC8B/5By1 9RPC7cI0WQu55zlM+O+6Mte7BsC6IbNob1gZ/8jhgluh6OEpORD7FqQcNDytamNZ+6f4 1YwX/vu/E05onsearg16eK7Q2Sk8iiy5idqhh0TVT9M0wjGgi0/l3/9OFRHuoGdIEx+N E1+YgBM5843IT2oqK+wd8UJn4oqpZqCOTm/G+cH4BZomZwenxhAc1BOZs7XpkxbzrwqI 5tZg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w3-v6si5286432plp.526.2018.03.29.01.57.27; Thu, 29 Mar 2018 01:57:42 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751913AbeC2I4X (ORCPT + 99 others); Thu, 29 Mar 2018 04:56:23 -0400 Received: from verein.lst.de ([213.95.11.211]:49398 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751179AbeC2I4W (ORCPT ); Thu, 29 Mar 2018 04:56:22 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id A187B68D1A; Thu, 29 Mar 2018 10:56:21 +0200 (CEST) Date: Thu, 29 Mar 2018 10:56:21 +0200 From: Christoph Hellwig To: Keith Busch Cc: Christoph Hellwig , Baegjae Sung , axboe@fb.com, sagi@grimberg.me, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] nvme-multipath: implement active-active round-robin path selector Message-ID: <20180329085621.GB22215@lst.de> References: <20180327043851.6640-1-baegjae@gmail.com> <20180328080646.GB20373@lst.de> <20180328194741.GJ13039@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180328194741.GJ13039@localhost.localdomain> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 28, 2018 at 01:47:41PM -0600, Keith Busch wrote: > single host (single path from two hosts seems more common). If that's a > thing, we should get some numa awareness. I couldn't find your prototype, > though. I had one stashed locally from a while back and hope it resembles > what you had in mind: Mine was way older before the current data structures. Back then I used ->map_queues hacks that I'm glad I never posted :) > --- > struct nvme_ns *nvme_find_path_numa(struct nvme_ns_head *head) > { > int distance, current = INT_MAX, node = cpu_to_node(smp_processor_id()); > struct nvme_ns *ns, *path = NULL; > > list_for_each_entry_rcu(ns, &head->list, siblings) { > if (ns->ctrl->state != NVME_CTRL_LIVE) > continue; > if (ns->disk->node_id == node) > return ns; > > distance = node_distance(node, ns->disk->node_id); > if (distance < current) { > current = distance; > path = ns; > } > } > return path; This is roughly what I'd do now. The other important change would be to have a per-node cache of the current path so that we don't do it in the hot path.