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 D9300C433F5 for ; Tue, 22 Feb 2022 05:41:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5D32C8D0006; Tue, 22 Feb 2022 00:41:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 55AD58D0001; Tue, 22 Feb 2022 00:41:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3D5AE8D0006; Tue, 22 Feb 2022 00:41:22 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0087.hostedemail.com [216.40.44.87]) by kanga.kvack.org (Postfix) with ESMTP id 2A8C38D0001 for ; Tue, 22 Feb 2022 00:41:22 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id E4D449F5C0 for ; Tue, 22 Feb 2022 05:41:21 +0000 (UTC) X-FDA: 79169317962.18.5D7ED86 Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by imf19.hostedemail.com (Postfix) with ESMTP id 6AD6F1A0002 for ; Tue, 22 Feb 2022 05:41:21 +0000 (UTC) Received: by mail-pj1-f54.google.com with SMTP id ci24-20020a17090afc9800b001bc3071f921so1298849pjb.5 for ; Mon, 21 Feb 2022 21:41:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DF/LA0DJAyi2WkgDraeDPTQYetYLIgsh4V0sksoNxzk=; b=pauzJMJQ80pndaDK1GCL00PrQYlmURkbBHxp5EYP4alcPDhwEYiE3PGsaVWmuzwyx8 yDc0O6G+EKinFKPyAVhHXNSWWrlhN5V6Nwj10pGm1+cZoXVlCcqVfw2Z8kWDsFCJ1lKp V9ijY5loDbTA2wnRyzF2T9aP/i6DiUxCLLzqoJb90HxytGV6d6/guf58n+b4D1CMiQfJ deQRBEHB14gFWu+UocLv+P81SyQ/l/ay467CP/26OKI2k7cl1Xn2yTH2Adb+0VxKm39a 1EffzbbcUUiJsLSjNtqEP0lDEuk9j4lx6X6bqQITLpdzcIG9peoaS+FN+4kfPi7x6fYc DZGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DF/LA0DJAyi2WkgDraeDPTQYetYLIgsh4V0sksoNxzk=; b=wcuHjZ/YX47tispC+RD1X0uAai7OY6uIvEWdHBRbe6+C6LzCbt12PuSPniDIe9N2Ub UrQoWngqFmcETbOeCruTM9AlZ0EhPEelnSuheX0CbhxyGMXP+VjnaH9hh5qTT56RJhau 4ih/TKQ5G+G8cjW8nRaIGAku4MbhfxBKNVpkXX4zmujj/g3KjQdw7a+DlXE+VoY9xd06 2USl5i3QF1kqc97XbP3tccdx167EqyjMqbcTGEE+MVJ3qlZkFMkXnlnPSU/EIGmBzIbU Upw3Xnkl0hBNOfajAFN00OqfWpbyyJX1DeOvugsj8+HkCEHGdNnLxGxJETKRvItD4DeH cSuQ== X-Gm-Message-State: AOAM532YIXBzUSQAbIwSkiiRwwLkq6fQLu5ej8ofcTWdetemIz+F7lXq bHPxT1puXXDCXe10ZEB38e+YeTlcc2L5iNglZ8akvQ== X-Google-Smtp-Source: ABdhPJwZgkpqy+pZ8gDweXscqKjdRcJzeUeapNsNrGvI0e1FCqTYp6CiISQbcks56p8KzThnUZ+zUi+2jWzNNxeXEmc= X-Received: by 2002:a17:90a:ac14:b0:1bc:2b81:4f5d with SMTP id o20-20020a17090aac1400b001bc2b814f5dmr2441754pjq.207.1645508480157; Mon, 21 Feb 2022 21:41:20 -0800 (PST) MIME-Version: 1.0 References: <20220221182540.380526-1-bigeasy@linutronix.de> <20220221182540.380526-4-bigeasy@linutronix.de> In-Reply-To: <20220221182540.380526-4-bigeasy@linutronix.de> From: Shakeel Butt Date: Mon, 21 Feb 2022 21:41:08 -0800 Message-ID: Subject: Re: [PATCH v4 3/6] mm/memcg: Protect per-CPU counter by disabling preemption on PREEMPT_RT where needed. To: Sebastian Andrzej Siewior Cc: Cgroups , Linux MM , Andrew Morton , Johannes Weiner , Michal Hocko , =?UTF-8?Q?Michal_Koutn=C3=BD?= , Peter Zijlstra , Thomas Gleixner , Vladimir Davydov , Waiman Long , Roman Gushchin Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 6AD6F1A0002 X-Stat-Signature: 7r7sepgsmpha4dxueecdz57f14o1179e Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=pauzJMJQ; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf19.hostedemail.com: domain of shakeelb@google.com designates 209.85.216.54 as permitted sender) smtp.mailfrom=shakeelb@google.com X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1645508481-516176 X-Bogosity: Ham, tests=bogofilter, spamicity=0.021116, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Feb 21, 2022 at 10:26 AM Sebastian Andrzej Siewior wrote: > [...] > + /* > + * The caller from rmap relay on disabled preemption becase they never > + * update their counter from in-interrupt context. For these two > + * counters we check that the update is never performed from an > + * interrupt context while other caller need to have disabled interrupt. > + */ > + __memcg_stats_lock(); > + if (IS_ENABLED(CONFIG_DEBUG_VM)) { > + if (idx == NR_ANON_MAPPED || idx == NR_FILE_MAPPED) NR_ANON_THPS, NR_SHMEM_PMDMAPPED, NR_FILE_PMDMAPPED are missing and the switch statement would be cleaner. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shakeel Butt Subject: Re: [PATCH v4 3/6] mm/memcg: Protect per-CPU counter by disabling preemption on PREEMPT_RT where needed. Date: Mon, 21 Feb 2022 21:41:08 -0800 Message-ID: References: <20220221182540.380526-1-bigeasy@linutronix.de> <20220221182540.380526-4-bigeasy@linutronix.de> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DF/LA0DJAyi2WkgDraeDPTQYetYLIgsh4V0sksoNxzk=; b=pauzJMJQ80pndaDK1GCL00PrQYlmURkbBHxp5EYP4alcPDhwEYiE3PGsaVWmuzwyx8 yDc0O6G+EKinFKPyAVhHXNSWWrlhN5V6Nwj10pGm1+cZoXVlCcqVfw2Z8kWDsFCJ1lKp V9ijY5loDbTA2wnRyzF2T9aP/i6DiUxCLLzqoJb90HxytGV6d6/guf58n+b4D1CMiQfJ deQRBEHB14gFWu+UocLv+P81SyQ/l/ay467CP/26OKI2k7cl1Xn2yTH2Adb+0VxKm39a 1EffzbbcUUiJsLSjNtqEP0lDEuk9j4lx6X6bqQITLpdzcIG9peoaS+FN+4kfPi7x6fYc DZGA== In-Reply-To: <20220221182540.380526-4-bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org> List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Sebastian Andrzej Siewior Cc: Cgroups , Linux MM , Andrew Morton , Johannes Weiner , Michal Hocko , =?UTF-8?Q?Michal_Koutn=C3=BD?= , Peter Zijlstra , Thomas Gleixner , Vladimir Davydov , Waiman Long , Roman Gushchin On Mon, Feb 21, 2022 at 10:26 AM Sebastian Andrzej Siewior wrote: > [...] > + /* > + * The caller from rmap relay on disabled preemption becase they never > + * update their counter from in-interrupt context. For these two > + * counters we check that the update is never performed from an > + * interrupt context while other caller need to have disabled interrupt. > + */ > + __memcg_stats_lock(); > + if (IS_ENABLED(CONFIG_DEBUG_VM)) { > + if (idx == NR_ANON_MAPPED || idx == NR_FILE_MAPPED) NR_ANON_THPS, NR_SHMEM_PMDMAPPED, NR_FILE_PMDMAPPED are missing and the switch statement would be cleaner.