Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp3101846pxb; Tue, 20 Apr 2021 00:06:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybRgd+pKZ4WohnsARM9Nm97Q+GEjfnuWhEMAFKdGqAvwxPg3eb5icWVNeGiEPHNELo3Iby X-Received: by 2002:a17:907:96a9:: with SMTP id hd41mr25348048ejc.255.1618902386907; Tue, 20 Apr 2021 00:06:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618902386; cv=none; d=google.com; s=arc-20160816; b=cSr8AdfHP/vgHHEyoO0HNY1m6+IKMaf4R0VHPvA2JTfp3lT+UK9ILinYCe+jWAXAnG bXsCP2fEJ+Z5h9S1afc6lEZhc4p/KLmgrwnDcCn2p8BBMJS/WmC8p7CNhUd3Oxbg80hK EwWEmnBJypsZNX3maeevSpHMtnwV9i88teMRsaWBd00m9deWUZdmfNuNZZ9UNsfxoJwM 4YkTU8eDmoGBBeGNzCn8PC76qVrGhhxmBdorFJOHnZjRdMu3C7UsqugOwafu+rdJCleL uv1UnI/Khy6se6qBf1WOCmcBXlkMCAi5Vx6A7hs6/yAkU563dYvCj5oB/BGYf/qevf+i HVsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=S28F6Esk+D8dcXxbzF3+5LdtdDhDVFkM7q+K8PcVcuA=; b=odDraf4KL8vObHE2WT0JBzVvXUpCb4tJYQnlxP+d5k24SN6hKZAQHbqOJ9YFpsq95Y JlHPVzL+HMrxp/XI3Sr64cxh/MxcbM78raK7u+mh00JwTpw7aoyP6DDBj9z0PBT//rEA pgzj/lxQeYChhXSM9MT4NkKHaytdi0j/n7ZiPYaaZJFQeYQKl1w+97r1O/VVfa66TJQB ZKyXparUstGS/nv1UTKuHLB5rcEJG14tMHOjK2Lz2P3m7+zD/KPwo7oXQ/ff1GRXIuLJ oDIzmqN8cwIfmVkSn4YQTEf0ZVtXWu8hZwU4wjl2B304zNHpYPzpEJbbuAF9eyNSFqFB 60FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=lPuVJltq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ds10si16981719ejc.709.2021.04.20.00.06.01; Tue, 20 Apr 2021 00:06:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=lPuVJltq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230188AbhDTHF0 (ORCPT + 99 others); Tue, 20 Apr 2021 03:05:26 -0400 Received: from mx2.suse.de ([195.135.220.15]:47392 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230018AbhDTHFZ (ORCPT ); Tue, 20 Apr 2021 03:05:25 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1618902294; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=S28F6Esk+D8dcXxbzF3+5LdtdDhDVFkM7q+K8PcVcuA=; b=lPuVJltq9PaXSJxcyrY5c4MEe/mGjPi4zdRny/TzzxMqNPSwyDX8Tg+rckvKD8F+d4z1nW 5UFeIbGPKb2dVa8v2gnpzYTAI64GxxFnFVivgpMzhaVX8VHlLvaHb7sTWa6oNG9pbDdWP8 HGI8DPlQu+mFoOyQgJT/icH5D4fefb0= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id D7550B137; Tue, 20 Apr 2021 07:04:53 +0000 (UTC) Date: Tue, 20 Apr 2021 09:04:51 +0200 From: Michal Hocko To: Christian =?iso-8859-1?Q?K=F6nig?= Cc: Peter.Enderborg@sony.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, sumit.semwal@linaro.org, adobriyan@gmail.com, akpm@linux-foundation.org, songmuchun@bytedance.com, guro@fb.com, shakeelb@google.com, neilb@suse.de, samitolvanen@google.com, rppt@kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, willy@infradead.org Subject: Re: [PATCH v4] dma-buf: Add DmaBufTotal counter in meminfo Message-ID: References: <20210417104032.5521-1-peter.enderborg@sony.com> <23aa041b-0e7c-6f82-5655-836899973d66@sony.com> <07ed1421-89f8-8845-b254-21730207c185@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <07ed1421-89f8-8845-b254-21730207c185@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 19-04-21 18:37:13, Christian K?nig wrote: > Am 19.04.21 um 18:11 schrieb Michal Hocko: [...] > > The question is not whether it is NUMA aware but whether it is useful to > > know per-numa data for the purpose the counter is supposed to serve. > > No, not at all. The pages of a single DMA-buf could even be from different > NUMA nodes if the exporting driver decides that this is somehow useful. As the use of the counter hasn't been explained yet I can only speculate. One thing that I can imagine to be useful is to fill gaps in our accounting. It is quite often that the memroy accounted in /proc/meminfo (or oom report) doesn't add up to the overall memory usage. In some workloads the workload can be huge! In many cases there are other means to find out additional memory by a subsystem specific interfaces (e.g. networking buffers). I do assume that dma-buf is just one of those and the counter can fill the said gap at least partially for some workloads. That is definitely useful. What I am trying to bring up with NUMA side is that the same problem can happen on per-node basis. Let's say that some user consumes unexpectedly large amount of dma-buf on a certain node. This can lead to observable performance impact on anybody on allocating from that node and even worse cause an OOM for node bound consumers. How do I find out that it was dma-buf that has caused the problem? See where I am heading? -- Michal Hocko SUSE Labs