From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3FD6C05027 for ; Tue, 7 Feb 2023 01:01:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 24BD36B0071; Mon, 6 Feb 2023 20:01:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1FBEF6B0073; Mon, 6 Feb 2023 20:01:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0C4316B0074; Mon, 6 Feb 2023 20:01:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id EE89F6B0071 for ; Mon, 6 Feb 2023 20:01:05 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id BC0B280790 for ; Tue, 7 Feb 2023 01:01:05 +0000 (UTC) X-FDA: 80438691690.09.CC6E9A8 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf10.hostedemail.com (Postfix) with ESMTP id 60E83C002A for ; Tue, 7 Feb 2023 01:01:03 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="RUN85eE/"; spf=pass (imf10.hostedemail.com: domain of longman@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=longman@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1675731663; h=from:from:sender:reply-to:subject:subject: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:dkim-signature; bh=DXqw41zJAY6Fl3i7sZ9FDkyQtJd0VRXI/SNzWbqT0Bw=; b=G98OYs54BjdNAMDd7sB9BCVQpUVrqyYQleVP+LJw8yKyaxs/knJB5ZMssNq46NwHGVGTfW rGc8GPDU1/AyZwviFs4veP7ZqjQNWTq+1R1VGPrMuwErTqPsKNtsdNo0mHxhZTVJDjelGW 20hdGx1Z1Sl3BaQzPKSeKgwrI2S1NeA= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="RUN85eE/"; spf=pass (imf10.hostedemail.com: domain of longman@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=longman@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1675731663; a=rsa-sha256; cv=none; b=8I43sewA22i1Te5VcE0GplBgDIQR2wqNaZ49rjXUywe7gn18A4MbMRXX827EQQ/E/fEtU/ WHiTXkLKeuKqJ2uGSf4p/qnzZrZPgrO8BFlKKNwkK0wBqLvj5goTinPrN36e56gDdO4gAR SFyyfG8UCEQ9D2xDGi/Udu4PfU5Ks6I= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675731662; h=from:from:reply-to:subject:subject: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=DXqw41zJAY6Fl3i7sZ9FDkyQtJd0VRXI/SNzWbqT0Bw=; b=RUN85eE/yAX/D15kx3YySm7Y8mOE+gP2O+7m/I6gvzPiihJB+A14fZFYpSuihneQdDEtCn chyArK6t+3WqA25a7VsEolKOZbUcGuLfQE4K8DkNnMKQm59RHdd3hzSOQKMIhpPZJkmNBo eYG/At4FuHI0fEdvb1e7Rpd/Euh9WN8= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-659-MisY_-TcPtyqLVDHujBbpQ-1; Mon, 06 Feb 2023 20:00:56 -0500 X-MC-Unique: MisY_-TcPtyqLVDHujBbpQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 949893C0F22C; Tue, 7 Feb 2023 01:00:55 +0000 (UTC) Received: from [10.22.18.235] (unknown [10.22.18.235]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5E687492B21; Tue, 7 Feb 2023 01:00:54 +0000 (UTC) Message-ID: <24668a43-fb00-5240-6072-230c5f5d0943@redhat.com> Date: Mon, 6 Feb 2023 20:00:54 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH 14/19] mm: Introduce a cgroup for pinned memory Content-Language: en-US To: Yosry Ahmed , Tejun Heo Cc: Alistair Popple , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, jgg@nvidia.com, jhubbard@nvidia.com, tjmercier@google.com, hannes@cmpxchg.org, surenb@google.com, mkoutny@suse.com, daniel@ffwll.ch, "Daniel P . Berrange" , Alex Williamson , Zefan Li , Andrew Morton References: From: Waiman Long In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: 5in1c71inko63ajyj3x4bgdsqkfs96yi X-Rspamd-Queue-Id: 60E83C002A X-HE-Tag: 1675731663-890159 X-HE-Meta: U2FsdG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ovBbaOGpwYriRL3Du8fty42qthGUdXaK6pSnfdzWevrWq5P+XLWdljEIcz93Z78TJi6o/R9ubLYzRkdw14LeIrObJ2iFiOcEqvBY7yUbYNcdVPE7ey2EtAt+3Di3F7yLIFZ2S/g= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 2/6/23 17:39, Yosry Ahmed wrote: > On Mon, Feb 6, 2023 at 2:36 PM Tejun Heo wrote: >> On Mon, Feb 06, 2023 at 02:32:10PM -0800, Yosry Ahmed wrote: >>> I guess it boils down to which we want: >>> (a) Limit the amount of memory processes in a cgroup can be pinned/locked. >>> (b) Limit the amount of memory charged to a cgroup that can be pinned/locked. >>> >>> The proposal is doing (a), I suppose if this was part of memcg it >>> would be (b), right? >>> >>> I am not saying it should be one or the other, I am just making sure >>> my understanding is clear. >> I don't quite understand what the distinction would mean in practice. It's >> just odd to put locked memory in a separate controller from interface POV. > Assume we have 2 cgroups, A and B. A process in cgroup A creates a > tmpfs file and writes to it, so the memory is now charged to cgroup A. > Now imagine a process in cgroup B tries to lock this memory. > - With (a) the amount of locked memory will count toward's cgroup A's > limit, because cgroup A is charged for the memory. > - With (b) the amount of locked memory will count toward's cgroup B's > limit, because a process in cgroup B is locking the memory. > > I agree that it is confusing from an interface POV. If it should not be part of the memcg, does it make sense to make it a resource in the existing misc controller? I believe we don't want a proliferation of new cgroup controllers. Cheers, Longman