Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp3125583pxb; Tue, 20 Apr 2021 00:47:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgzbl83AWIzrsj+6F+eyPUX9GXf9siM5/7UcDpCMQsynZqUJBTAchrrt96c3WbkCMcXNyi X-Received: by 2002:a05:6402:1157:: with SMTP id g23mr30427275edw.303.1618904860896; Tue, 20 Apr 2021 00:47:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618904860; cv=none; d=google.com; s=arc-20160816; b=iSMaCyOV4DX1QDRLUE2fGIpVNBga2QRRIrqIk8R6FLhCf7+7eP++oTboTiGElvr2wB OEsYC806FctrEgxLtYkOky5gVzmcoZkUL7mrrAdT/RO79clGHgpQwACGA/O2k2r++Sn+ Oal8JCTufb11e7PR5H8T70jxr+TryvaQAu+q0YqKySIRe+h/O/2ExMssMMpvwcfRzFGd 5Rp5PrynIUEonm+Won/WYKdOpv7NFHYQ2oltaj7D1U5RU6y5eq4yShBh+An00rBG8WL7 itbN0ylJFukzyRpAOR7mXU1l2dzMz/qxALjNJQ5jh+NXdZLumLDUassdTMiMahRHMST/ eE6A== 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=NKKvUHvInZtSl6fOY6WNFgQFeLocZJjqN5OxLOUVXKc=; b=BTiVEq7JgozU3CB0znjU40q+Wa4rE9Cypa5hoDqycNwPDFhWJCmIh0OECOobh1TQY0 B89osmUNH96BJhqjXxzzLi1sxFkdqdEZUmNvuvZhdQkCDuqZ23LpRwrko26ZsrlHPtgm zTPU5cS9/MmH2vPfnElzBlS4CqDT8fvRtkUjRiB4VOSguDs23OsivtYTmamNzZ2h9GSd pXUIcP/h2MhGS2ZRcV4H2mNBG2t2/ySZNXaNlS5DLduPS2zJ5peCr8uug2rx0Vc7nCtr JCYDhiTdShX23AWRL30m4eiCXBj4182oFLcLInSRnr5ql4RxLpn3Z/awtQq0gWl32EHy KvRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=WPBB95xB; 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 i11si16594324edb.109.2021.04.20.00.47.17; Tue, 20 Apr 2021 00:47:40 -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=WPBB95xB; 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 S229699AbhDTHq6 (ORCPT + 99 others); Tue, 20 Apr 2021 03:46:58 -0400 Received: from mx2.suse.de ([195.135.220.15]:36024 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229471AbhDTHq5 (ORCPT ); Tue, 20 Apr 2021 03:46:57 -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=1618904785; 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=NKKvUHvInZtSl6fOY6WNFgQFeLocZJjqN5OxLOUVXKc=; b=WPBB95xBOuxAjCK++fJ0G3px9LAUkWSK+u2Xx9QDmRJZugf/lc4wkT7fjYqTDqj2iqV9pT DTRvT2GoUrskRPrEe2yFoWssk3ncDMA/M5jjyXji8T8cfiq+XutGshEBhaz08LgT4x3co5 kbmYV7vdhrkRBwGeXjVX93SfJ0Y2YnI= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 09C98B2D9; Tue, 20 Apr 2021 07:46:25 +0000 (UTC) Date: Tue, 20 Apr 2021 09:46:17 +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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 20-04-21 09:32:14, Christian K?nig wrote: > Am 20.04.21 um 09:04 schrieb Michal Hocko: > > On Mon 19-04-21 18:37:13, Christian K?nig wrote: > > > Am 19.04.21 um 18:11 schrieb Michal Hocko: [...] > > 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? > > Yes, that is the direction my thinking goes as well, but also even further. > > See DMA-buf is also used to share device local memory between processes as > well. In other words VRAM on graphics hardware. > > On my test system here I have 32GB of system memory and 16GB of VRAM. I can > use DMA-buf to allocate that 16GB of VRAM quite easily which then shows up > under /proc/meminfo as used memory. This is something that would be really interesting in the changelog. I mean the expected and extreme memory consumption of this memory. Ideally with some hints on what to do when the number is really high (e.g. mount debugfs and have a look here and there to check whether this is just too many users or an unexpected pattern to be reported). > But that isn't really system memory at all, it's just allocated device > memory. OK, that was not really clear to me. So this is not really accounted to MemTotal? If that is really the case then reporting it into the oom report is completely pointless and I am not even sure /proc/meminfo is the right interface either. It would just add more confusion I am afraid. > > See where I am heading? > > Yeah, totally. Thanks for pointing this out. > > Suggestions how to handle that? As I've pointed out in previous reply we do have an API to account per node memory but now that you have brought up that this is not something we account as a regular memory then this doesn't really fit into that model. But maybe I am just confused. -- Michal Hocko SUSE Labs