From patchwork Fri Jun 28 21:03:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Gushchin X-Patchwork-Id: 13716630 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 39656C2BD09 for ; Fri, 28 Jun 2024 21:04:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9A3376B00A9; Fri, 28 Jun 2024 17:04:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9542D6B00AA; Fri, 28 Jun 2024 17:04:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6C85B6B00AB; Fri, 28 Jun 2024 17:04:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 4B2C06B00A9 for ; Fri, 28 Jun 2024 17:04:07 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 08F9D40760 for ; Fri, 28 Jun 2024 21:04:07 +0000 (UTC) X-FDA: 82281524934.06.3D565D8 Received: from out-185.mta1.migadu.com (out-185.mta1.migadu.com [95.215.58.185]) by imf12.hostedemail.com (Postfix) with ESMTP id 0ADFD4001F for ; Fri, 28 Jun 2024 21:04:03 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=AxQxHOwo; spf=pass (imf12.hostedemail.com: domain of roman.gushchin@linux.dev designates 95.215.58.185 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719608630; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=shh94uljBJBAw0NmdKQ5/8JVCufhJ/PY7mLMRWfBY9w=; b=dz17Ru4ETgD8D5gAWv2hcV592BqV4y5Cl17RixOrDw2g+Huj7OSWzA++mfAY7YFars6weI 1aqFTwZIYxGqtesme/+q/XEPmqmzyOejhU8E9571LSzT9ZXSOW7BV6sv4Bh4tD/5PzIa+Q fVvAHvDhpWGQkytXkwX/qehpt1vpxd4= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=AxQxHOwo; spf=pass (imf12.hostedemail.com: domain of roman.gushchin@linux.dev designates 95.215.58.185 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719608630; a=rsa-sha256; cv=none; b=il/llT+8JogRgAxAn88WpH46vSB8g9QTTRNzH/dKdJDN9xiLkgM3TWsTYVnV8jmzuBvIpZ 8fzoiVXc11ElpO3bJ9Uo8v+5xlm7UaOdaPNFN3tXzuAlZZX9q/d2unZdntRi6tCyVfBREx hE4uo/37ajvP/+6aXEJXNUecCu+jIcc= X-Envelope-To: akpm@linux-foundation.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1719608642; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=shh94uljBJBAw0NmdKQ5/8JVCufhJ/PY7mLMRWfBY9w=; b=AxQxHOwohJvObzrg/JOuI9tKWrY6KLKGsGTTTeEwGVNcVD4DZmeJulWmaac1Kf9yRId4z0 4XilmuxIQnejQP1MwwDkF3W66UDLjc+GL8hRoRpgS0BbSZkbvujnqJRtXQx4N+4rj0jb50 rWGud2F7XVsBx5xOBoECY2lou0HhDuo= X-Envelope-To: linux-mm@kvack.org X-Envelope-To: linux-kernel@vger.kernel.org X-Envelope-To: hannes@cmpxchg.org X-Envelope-To: mhocko@kernel.org X-Envelope-To: shakeel.butt@linux.dev X-Envelope-To: muchun.song@linux.dev X-Envelope-To: roman.gushchin@linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Johannes Weiner , Michal Hocko , Shakeel Butt , Muchun Song , Roman Gushchin Subject: [PATCH v1 8/9] mm: memcg: put struct task_struct::memcg_in_oom under CONFIG_MEMCG_V1 Date: Fri, 28 Jun 2024 21:03:16 +0000 Message-ID: <20240628210317.272856-9-roman.gushchin@linux.dev> In-Reply-To: <20240628210317.272856-1-roman.gushchin@linux.dev> References: <20240628210317.272856-1-roman.gushchin@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Stat-Signature: 6r4aj6m37nuyxqa9oge1sdxuq8jjote1 X-Rspam-User: X-Rspamd-Queue-Id: 0ADFD4001F X-Rspamd-Server: rspam02 X-HE-Tag: 1719608643-895570 X-HE-Meta: U2FsdGVkX1+80ZABB/01+dcGdlwUNqnYQs7/h8+y2X0gg5kchYa5JyKpejXpnqp6IzfkChsdpOcCdfoDPUXSjo3bxyGI+IL+A9LdTyVJXcq2dEx7DcBS3JFthaRqFwlBnYAABf24bse/YF75gAgaFARiO427NYxSvHRmqmTYLVMAgqQ8O2vIn1CBXw3rp3YYd9WJoeGhg2ExfpVN4giqz7GkI6RECnU4ywpg1sM2h9DQ47elKBXCDm8jxCXt2NK8rf8B0UwBN9nLKLPu+qdsxEXAqnN33cgdES6DR1D4FsEtXfd7BF06QYPojTBz7RtbYoHqmslVyMlJY6nTGVPyE58gj/2JI708cp12zXHwGJOTwKJgwwnWyqO1tALx2+zvEuxO7egItE3bWQ9bVbWPPzVey2Xp2z7XpxVmP2Iu5EsYtbbJrKlLI2EeeV4vz/nf1lJ4ZtP+2/zZ9EZz/7yc7aKr8D1eF53Ize876Z3WGNXuA0fRs84j3VZOdpBX0zdMQG7m9WwcLMdyRher0Z8qgJkHhLSb3CnnV8DllrcvtoFeQfX2htTumwLs+S+0Rzo1YY0ij37i1nsrkHvqL0rQT4SSrnhLJeK52wBa2D1yHp4xQynUgsd+9tj7VCxFNvmupU4DiSi2Sdf+3FzyGgfd4SWOLl+Om8jr3svFh9Z8hUOy9tKUEU443n0GPdQX/sosC3hv4XPEEsd6Kkz0pgPj578HjI9sddyXwtc8mFzQm2VrNUk4H3l2OflUEH2yBXmqGQw7TQsf6XJBVDOdYgsKb8587UelQSMX/tKVUbvh3p+LKeBk9wAxBqWnFerMr9ZzCvyCiLdDyd+cqbk6O73q7H3mhvsznUs2iIsbdAuicI49/MLaImov/7QxYlGuRKqBOpWP0J906VSZ7msjrP+x5GaYP7w6D8xPE7vR2GvixdiVJX5xzL8YBtO6LyfRf0BrOL8qJ6QS31yPGpDs8fU Ud0m+ILS gHWNGXbAR89bNMzhT1Rtcr3AXMfwmusz+/NowAx9zH9Ga9Axfv5RQWjg0t049+OsopiWGxQEZ4kGuFqwlOb9qp/0jIYmvj4pKSYbgOzBlJCapcm0mk8AGAfAozVw4Me77hFCjG/fdcXQfgJ8GZ+nbCW8gpRISvM2XWQO4 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: List-Subscribe: List-Unsubscribe: The memcg_in_oom field of the struct task_struct is not used by the cgroup v2's memory controller, so it can be happily compiled out if CONFIG_MEMCG_V1 is not set. Signed-off-by: Roman Gushchin Acked-by: Shakeel Butt --- include/linux/sched.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index 61591ac6eab6..2a16023e8620 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1447,9 +1447,11 @@ struct task_struct { unsigned int kcov_softirq; #endif -#ifdef CONFIG_MEMCG +#ifdef CONFIG_MEMCG_V1 struct mem_cgroup *memcg_in_oom; +#endif +#ifdef CONFIG_MEMCG /* Number of pages to reclaim on returning to userland: */ unsigned int memcg_nr_pages_over_high;