Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp973923pxb; Wed, 6 Apr 2022 05:46:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwD8qk8kYsnZ2AqUFr3el46BdjJKhn+FrAJbNpU5kvex3Cv9Q69V2DkOoznYeSdoS/sjLd1 X-Received: by 2002:a17:903:1246:b0:155:c376:e5a0 with SMTP id u6-20020a170903124600b00155c376e5a0mr8088252plh.167.1649249166544; Wed, 06 Apr 2022 05:46:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649249166; cv=none; d=google.com; s=arc-20160816; b=MNWp6trfMJLNIXl1iBBJIBy8MZceTCCNffp7InXo7N3hCOFnpK9hcsILnD+22P3kme X0EHgUJvYIrIHo5DZL33pxi9V4wSQsPmaPI4qGvqN8uPumMJr3HZ5gRHsTFlobevjdDf 15xfe2h2/lgJxEezPr37F9fEUwljegSME3ltScnO6V/okXM/+4dqI16slWypUcxI3Jhe reHEw7181XBrqCPWeeuHJIdUMV4N9hiGaXoDzji7lFmFiEF0wc5GV/8mPZQ5Z/tRxXRK ojmYScsbYOBPJvQzCQEtoYPp9/P2nH0X0tb+RnGcVnm9Y/VVNaTvVgq0g/4drjzTtQ6N ln6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=YGolTQlWegdqsJgfgfOCgFdotBM/n5qIvgfFfvEjxd0=; b=jnxu+XWbMp9ztnIzQa6JvzQnNeOY4zR+EUNEY8u8qw4yUFzqJS1JKviOwOMfFuRsof JTAeqo92aAyKPAd3mtvchNOT3wG9G284ybqgIsG9bLlvuwHAiBrERnnlzVd6ikaFY/9Z ImcKWOGOzSehBjfot0K7HXgRV+xID0gyKqTgLmL5lRkP/qjAAQNa+J/TPoYqtFkB0q/a wSRlIXUoXhsXVpbC2mqK3r49f6EB0Au+ANABWNWcLbN6JzSQY6fRl+c0JoWGgNqLjctI WzcwMFgPE/2rhp6UwGmskU7VA/90JBLOo+GCbT07Sti+gydx9XxCgYV7Ov2t1I8sd6GS SDGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=BK6a6qL8; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id n2-20020a170902e54200b00156d87887eesi3959205plf.83.2022.04.06.05.46.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 05:46:06 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=BK6a6qL8; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 548923E14BA; Wed, 6 Apr 2022 02:23:35 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1838237AbiDFAuv (ORCPT + 99 others); Tue, 5 Apr 2022 20:50:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377013AbiDENMq (ORCPT ); Tue, 5 Apr 2022 09:12:46 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFF7D120D9D; Tue, 5 Apr 2022 05:12:48 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 2FE681F745; Tue, 5 Apr 2022 12:12:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1649160767; 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=YGolTQlWegdqsJgfgfOCgFdotBM/n5qIvgfFfvEjxd0=; b=BK6a6qL8o7p/MJgbNqqctnSF5bmv5BGKuuqBTv2USITbTpPoKI1f15ogW871KoTo/RdheN 2ofE8y9/q59bmAhdL1seIYTAGQd263xP4FVoKwCcc/FYdRc3tUwqP3pmlISrihOeY4NF+U B5AcViJAx3CYaDGctEIJbO7LJzMoxwU= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id AA5C913A04; Tue, 5 Apr 2022 12:12:46 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id s8TPKD4yTGIlCAAAMHmgww (envelope-from ); Tue, 05 Apr 2022 12:12:46 +0000 Date: Tue, 5 Apr 2022 14:12:45 +0200 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: "T.J. Mercier" Cc: David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Jonathan Corbet , Greg Kroah-Hartman , Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Christian Brauner , Hridya Valsaraju , Suren Baghdasaryan , Sumit Semwal , Christian =?iso-8859-1?Q?K=F6nig?= , Benjamin Gaignard , Liam Mark , Laura Abbott , Brian Starkey , John Stultz , Tejun Heo , Zefan Li , Johannes Weiner , Shuah Khan , Kalesh Singh , Kenny.Ho@amd.com, Shuah Khan , dri-devel@lists.freedesktop.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, cgroups@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [RFC v4 5/8] dmabuf: Add gpu cgroup charge transfer function Message-ID: <20220405121245.GA30368@blackbody.suse.cz> References: <20220328035951.1817417-1-tjmercier@google.com> <20220328035951.1817417-6-tjmercier@google.com> <20220329152142.GA15794@blackbody.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) X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 01, 2022 at 11:41:36AM -0700, "T.J. Mercier" wrote: > This link doesn't work for me, but I think you're referring to the > discussion about your "RAM_backed_buffers" comment from March 23rd. (Oops, it's a non-public message. But yes, you guessed it right ;-)) > Anyway the test I did goes like this: enable memcg and gpu cgoups > tracking and run a process that allocates 100MiB of dmabufs. Observe > memcg and gpu accounting values before and after the allocation. Thanks for this measurement/dem/demoo. > Before > # cat memory.current gpu.memory.current > 14909440 > system 0 > > > > After > # cat memory.current gpu.memory.current > 48025600 > system 104857600 > > So the memcg value increases by about 30 MiB while the gpu values > increases by 100 MiB. > This is with kmem enabled, and the /proc/maps > file for this process indicates that the majority of that 30 MiB is > kernel memory. > I think this result shows that neither the kernel nor process memory > overlap with the gpu cgroup tracking of these allocations. It depends how the semantics of the 'system' entry is defined, no? As I grasped from other thread, the 'total' is going to be removed, so 'system' represents exclusively device memory? > So despite the fact that these buffers are in main memory, they are > allocated in a way that does not result in memcg attribution. (It > looks to me like __GFP_ACCOUNT is not set for these.) (I thought you knew what dmabufs your program used :-p) So, the goal is to do the tracking and migrations only via the gpu cg layer, regardless how memcg charges it (or not). (I have no opinion on that, I'm just summing it so that we're on the same page.) Michal