Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp344949ybx; Wed, 6 Nov 2019 01:23:13 -0800 (PST) X-Google-Smtp-Source: APXvYqzy70JXflGkSCgVxgVa0cfP5EKyCbIDv5BjWbq4tCoPtgCILTKXarhRj7SYDOQ2rHm2oVnt X-Received: by 2002:a05:6402:1718:: with SMTP id y24mr1468699edu.220.1573032193295; Wed, 06 Nov 2019 01:23:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573032193; cv=none; d=google.com; s=arc-20160816; b=cFcOcD4irGJbJBxHAsqtauNxmM9xlo4wQwLvGXaa6jn/cG1um+Lt0eXTXUbdXzZiSe /GKFw9RQCTzmnOHAhid9gyj7WrWkIK0OEoqonHYX1fMkzs+5OTvwdgbG0le8VSFSETZg pohp+pY9TxxKODQYzUYngcuBEib4w8AMPLOFwM0WjGtnCaKpoTjqQNM5HWJ8uOnF4zfV PNwb7NGXx/SbRFiUTxJVMEUZQsdry+ZY076a1Y3H1NblgRCgllYYZzc38JgwsTfuFxyb slHYJFleE7ZWENO9kirhAYRF5jYTSPE5fUi4vEsNZUobea6FJQiCProAVobUoHXHLKYo +vZg== 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; bh=OsLVw/GpMu3wNJShaG27qdSQHY5znK9wglC5ugb7I14=; b=h0FTsKUuaLeXjulz2H0ljS936EDvD0BkLhdoB6o6aIdXZAEPYdVSLqvVQPcjkRrN6j u7145EZGYDfljejNEh0cWMD3ht8EjDTvBf6rMaCrjx11H2XBdxIa1D/mEqAQC6xSbeKD 2d6jqEdWo2IDLYYp59Pn2blOzheD7KBpxrHTiRA7hY6Z77yJwAzFDMegEPEM2bzEq2I2 nYaK5a7ZUvmp6cZQM4sGqon8lU5Ga4lA1d6si2qHYMkM4UX89h23eWj3T1vhA61ptHDP z1etfh8D+WrX17vPhMJCdOcRYLjXeJYmmgiCNOkRrGSFhv2Iy0IZASPyQsp13WxZJ43+ /NbQ== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i1si1437865edn.235.2019.11.06.01.22.49; Wed, 06 Nov 2019 01:23:13 -0800 (PST) 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731494AbfKFJWL (ORCPT + 99 others); Wed, 6 Nov 2019 04:22:11 -0500 Received: from mx2.suse.de ([195.135.220.15]:36770 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727041AbfKFJWL (ORCPT ); Wed, 6 Nov 2019 04:22:11 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 82F36AC8C; Wed, 6 Nov 2019 09:22:09 +0000 (UTC) Date: Wed, 6 Nov 2019 10:22:08 +0100 From: Michal Hocko To: Shaokun Zhang Cc: Andrew Morton , linux-kernel@vger.kernel.org, yuqi jin , Mike Rapoport , Paul Burton , Michael Ellerman , Anshuman Khandual Subject: Re: [PATCH v2] lib: optimize cpumask_local_spread() Message-ID: <20191106092208.GE8314@dhcp22.suse.cz> References: <1572863268-28585-1-git-send-email-zhangshaokun@hisilicon.com> <20191105070141.GF22672@dhcp22.suse.cz> <20191105173359.39052327cf221d9c4b26b783@linux-foundation.org> <20191106071742.GB8314@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 06-11-19 16:02:29, Shaokun Zhang wrote: > Hi Michal, > > On 2019/11/6 15:17, Michal Hocko wrote: > > On Tue 05-11-19 17:33:59, Andrew Morton wrote: > >> On Tue, 5 Nov 2019 08:01:41 +0100 Michal Hocko wrote: > >> > >>> On Mon 04-11-19 18:27:48, Shaokun Zhang wrote: > >>>> From: yuqi jin > >>>> > >>>> In the multi-processor and NUMA system, I/O device may have many numa > >>>> nodes belonging to multiple cpus. When we get a local numa, it is > >>>> better to find the node closest to the local numa node, instead > >>>> of choosing any online cpu immediately. > >>>> > >>>> For the current code, it only considers the local NUMA node and it > >>>> doesn't compute the distances between different NUMA nodes for the > >>>> non-local NUMA nodes. Let's optimize it and find the nearest node > >>>> through NUMA distance. The performance will be better if it return > >>>> the nearest node than the random node. > >>> > >>> Numbers please > >> > >> The changelog had > >> > >> : When Parameter Server workload is tested using NIC device on Huawei > >> : Kunpeng 920 SoC: > >> : Without the patch, the performance is 22W QPS; > >> : Added this patch, the performance become better and it is 26W QPS. > > > > Maybe it is just me but this doesn't really tell me a lot. What is > > Parameter Server workload? What do I do to replicate those numbers? Is > > I will give it better description on it in next version. Since it returns > the nearest node from the non-local node than the random one, no harmless > to others, Right? Well, I am not really familiar with consumers of this API to understand the full consequences and that is why I keep asking. From a very highlevel POV prefering CPUs on the same NUMA domain sounds like a reasonable thing to do. -- Michal Hocko SUSE Labs