Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2611472pxb; Mon, 19 Apr 2021 09:31:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzJII5byBQ7NiuQcd3zLn+NeTgQoqXIfamWyhYJWqEom+jVcpnFDhnSqu1WtBAuNve8vl+ X-Received: by 2002:aa7:c549:: with SMTP id s9mr26270245edr.326.1618849919157; Mon, 19 Apr 2021 09:31:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618849919; cv=none; d=google.com; s=arc-20160816; b=zx83H+6i7TGbXQUlOy4x0kYSERDqv2KNf+1cmPVcVxFOq8T3E5rFgu1H2zks/vg1SQ hCBsk/5I+ZY5jzD51dVMv1q5dUT98ora4DXHJrKC9ttaafaa5HtYwf8V+RHlob0OffDZ oRTvzFT1WrkfyE7EA4wt/IZ+ur/82F9m84C/qr4Ihk8UEfWPAtgVHQUOunWjkpUjfoOm h91MZVf05n+h1c9+X0sxkEFOpi2SHkgs7ikzTBJA/brbKy16hoz4L8jtt51IT/AlMsPp r0JYCy6PjU/+aQJqhs0NkaJsIgiPB62CQtMqWoA046XSVo1m2cxbSKvFp1XYVOMTr2XS M3KA== 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=IQk9ADfQaNNFXvOrL+COJm80KdTtBuYEviWO6Fo/Waw=; b=QbB4Tpz1aeOa2y280cLDz/vU2BjbTLMGS6cJ4J9wlPGA/Tmf84zPxE2P/vzCJjvhLM wry8+0b/Hy3/pSBNtsHdLuZcFJxUvTsK5zprIklxhuk3viND/+TyiHWWDNGtblkt+h4P qztfAy58TfsasldGdvjFavfkmNPjhWjnsFs1WkJvB9T9vCd96ry/w/h6iI98IOsxpRK5 v5PuXO7E8CwE79EgJzYMJcWqvhujnQZ38h1bc4Eq08Xv0yndHfoaCBVOal3MYRTH3h0n qffQFxXRQSqkmDuK0fc/jsB0S7EX8X0ECYMHEDxbMnRRGunkDj7qvhGMshF3DFQXBLDS 9/HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=uZzLRuEc; 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 v11si9645666eju.403.2021.04.19.09.31.35; Mon, 19 Apr 2021 09:31:59 -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=uZzLRuEc; 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 S233508AbhDSQML (ORCPT + 99 others); Mon, 19 Apr 2021 12:12:11 -0400 Received: from mx2.suse.de ([195.135.220.15]:57550 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232633AbhDSQML (ORCPT ); Mon, 19 Apr 2021 12:12:11 -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=1618848700; 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=IQk9ADfQaNNFXvOrL+COJm80KdTtBuYEviWO6Fo/Waw=; b=uZzLRuEcAcZqW9RJseYmlhzfQHtxaf/mRn2Ut7Qy1w2i9hxJBbXTJJG8y2qjBse3YB3hIK XX+mNgRpm3ShzDsuzVAUJtdhz2+8b4y2j3Mbqth0GB4N/GeyDWEmGDrzdOGY5VzrXbpsOi XueYIA/gwpQVL5G1iD4exIV3wvMOlKg= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id D0857B000; Mon, 19 Apr 2021 16:11:39 +0000 (UTC) Date: Mon, 19 Apr 2021 18:11:39 +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> 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 Mon 19-04-21 17:44:13, Christian K?nig wrote: > Am 19.04.21 um 17:19 schrieb Peter.Enderborg@sony.com: > > On 4/19/21 5:00 PM, Michal Hocko wrote: > > > On Mon 19-04-21 12:41:58, Peter.Enderborg@sony.com wrote: > > > > On 4/19/21 2:16 PM, Michal Hocko wrote: > > > > > On Sat 17-04-21 12:40:32, Peter Enderborg wrote: > > > > > > This adds a total used dma-buf memory. Details > > > > > > can be found in debugfs, however it is not for everyone > > > > > > and not always available. dma-buf are indirect allocated by > > > > > > userspace. So with this value we can monitor and detect > > > > > > userspace applications that have problems. > > > > > The changelog would benefit from more background on why this is needed, > > > > > and who is the primary consumer of that value. > > > > > > > > > > I cannot really comment on the dma-buf internals but I have two remarks. > > > > > Documentation/filesystems/proc.rst needs an update with the counter > > > > > explanation and secondly is this information useful for OOM situations > > > > > analysis? If yes then show_mem should dump the value as well. > > > > > > > > > > From the implementation point of view, is there any reason why this > > > > > hasn't used the existing global_node_page_state infrastructure? > > > > I fix doc in next version.? Im not sure what you expect the commit message to include. > > > As I've said. Usual justification covers answers to following questions > > > - Why do we need it? > > > - Why the existing data is insuficient? > > > - Who is supposed to use the data and for what? > > > > > > I can see an answer for the first two questions (because this can be a > > > lot of memory and the existing infrastructure is not production suitable > > > - debugfs). But the changelog doesn't really explain who is going to use > > > the new data. Is this a monitoring to raise an early alarm when the > > > value grows? Is this for debugging misbehaving drivers? How is it > > > valuable for those? > > > > > > > The function of the meminfo is: (From Documentation/filesystems/proc.rst) > > > > > > > > "Provides information about distribution and utilization of memory." > > > True. Yet we do not export any random counters, do we? > > > > > > > Im not the designed of dma-buf, I think? global_node_page_state as a kernel > > > > internal. > > > It provides a node specific and optimized counters. Is this a good fit > > > with your new counter? Or the NUMA locality is of no importance? > > Sounds good to me, if Christian Koenig think it is good, I will use that. > > It is only virtio in drivers that use the global_node_page_state if > > that matters. > > DMA-buf are not NUMA aware at all. On which node the pages are allocated > (and if we use pages at all and not internal device memory) is up to the > exporter and importer. 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. -- Michal Hocko SUSE Labs