Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp3243714pxb; Tue, 20 Apr 2021 04:05:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3xX57jHwVh4cHc0ZpNjRV6scSou/PqL8nczomsl0pQLDBQAMucMA/5IJFgpWOAULIrqc+ X-Received: by 2002:a05:6402:a4a:: with SMTP id bt10mr31182290edb.39.1618916736114; Tue, 20 Apr 2021 04:05:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618916736; cv=none; d=google.com; s=arc-20160816; b=dDqfcWPlqzSJhNneaWTNdBgvSxv6Al4djd9+43xA/KNM6jUxNL2cUGOvYvW46J4nPp +lGxGRGffb6xaNRYIVVntfvOb/g+ciGZDjquYloqGEMXLwVO0DEe/KUBw9Ji+kQdiARs 3M/gGb7G+bim8z9H1+DuDCdvlQu4k1d+wgYRR12iS1p8ew3DJaVOLmf7Obcr1MlAEYeD bxlXPFsDqxSL2dhdDPi3/yx4v4L0TZ94W87srUH99CYZlxBu8fZkC+UzRrs1jMHRobYW b8Y+PcfhQZwqhlDWb36ejiFjmR7B0loVCcwSBp095xi+53YrrhRPeAoKqwxqYSkKs/Kq wFCA== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=7c1umvuq5ELjSt4WwfRDq7eVQxePycuZSiMlUA0otrY=; b=X9eU0CHQSCn5eeyKrsCLjyIzu8ZQpJ36AoR9/Z40z+i+LCh8zRUi03mn7D0Br9sLhw gMO2HUgVoqKpa/v9HX5UwDUV6AdCIQR3NuuVwZ9+Y4L2iCDSkQsOBFn1giGN+Qod9AQ3 NOKtBl2cVYmXDJ3IRgkhKrHO5dJEA3pAoTqU0e2oFWTwG1ScP7WaEOMwjnrW2DKiakQM UH/GqcW4tsJZJNpliHFBRwhXsOwB5rHPsbWKqRhb7SN/taq5KGiVoXxpnEVvTbDd1y4B Rp2DFjEclY3aSxoOzpFkySuINj+aDIpSXzsijPMuHKfeKNfNkOVbqHGmnI4Dcl/1WwK5 ZyMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=SsOPZ6h6; 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 js8si15173359ejc.236.2021.04.20.04.05.11; Tue, 20 Apr 2021 04:05:36 -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=SsOPZ6h6; 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 S231661AbhDTLEi (ORCPT + 99 others); Tue, 20 Apr 2021 07:04:38 -0400 Received: from mx2.suse.de ([195.135.220.15]:51272 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231388AbhDTLEh (ORCPT ); Tue, 20 Apr 2021 07:04:37 -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=1618916645; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7c1umvuq5ELjSt4WwfRDq7eVQxePycuZSiMlUA0otrY=; b=SsOPZ6h6g5IFGiSCAaRK5XTcbrpymneUn8n9gbjllBnAjMXd92IA+lg34lz88O+McxFKpK 1vsfWvClNffMWO2zU72LcnF+5csxyLIdbsqU4Z1MHoElWJXMqyPWY0p7RUTCOSMSH+HSgG kFqffDHVPLarUvYpV16Xg5c1QEVdU1I= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 196FAAF27; Tue, 20 Apr 2021 11:04:05 +0000 (UTC) Date: Tue, 20 Apr 2021 13:04:04 +0200 From: Michal Hocko To: Peter.Enderborg@sony.com Cc: christian.koenig@amd.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: <23aa041b-0e7c-6f82-5655-836899973d66@sony.com> <07ed1421-89f8-8845-b254-21730207c185@amd.com> <5efa2b11-850b-ad89-b518-b776247748a4@sony.com> <532d6d7e-372c-1524-d015-e15d79fcf11c@sony.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <532d6d7e-372c-1524-d015-e15d79fcf11c@sony.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 20-04-21 09:25:51, Peter.Enderborg@sony.com wrote: > On 4/20/21 11:12 AM, Michal Hocko wrote: > > On Tue 20-04-21 09:02:57, Peter.Enderborg@sony.com wrote: > >>>> 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. > >>> > >> Why is it confusing? Documentation is quite clear: > > Because a single counter without a wider context cannot be put into any > > reasonable context. There is no notion of the total amount of device > > memory usable for dma-buf. As Christian explained some of it can be RAM > > based. So a single number is rather pointless on its own in many cases. > > > > Or let me just ask. What can you tell from dma-bud: $FOO kB in its > > current form? > > It is better to be blind? No it is better to have a sensible counter that can be reasoned about. So far you are only claiming that having something is better than nothing and I would agree with you if that was a debugging one off interface. But /proc/meminfo and other proc files have to be maintained with future portability in mind. This is not a dumping ground for _some_ counters that might be interesting at the _current_ moment. E.g. what happens if somebody wants to have a per device resp. memory based dma-buf data? Are you going to change the semantic or add another 2 counters? -- Michal Hocko SUSE Labs