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 2FBA1CD11C2 for ; Sun, 7 Apr 2024 17:19:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B567A6B0089; Sun, 7 Apr 2024 13:19:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B07096B008C; Sun, 7 Apr 2024 13:19:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9F4E76B0092; Sun, 7 Apr 2024 13:19:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 8183B6B0089 for ; Sun, 7 Apr 2024 13:19:02 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 1EEA140268 for ; Sun, 7 Apr 2024 17:19:02 +0000 (UTC) X-FDA: 81983396124.27.20EEF08 Received: from out-182.mta0.migadu.com (out-182.mta0.migadu.com [91.218.175.182]) by imf18.hostedemail.com (Postfix) with ESMTP id 263271C000A for ; Sun, 7 Apr 2024 17:18:59 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=c9DHkc8d; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf18.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.182 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1712510340; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=av8DcUEUfW87NIOByp6zq/H9IyJ+V+DhnYtX85sC2lY=; b=E++ZkvuFwYSpAFdCit0esifp/TIa0PSDcNGGuWe0/VABZWtGVBb3gvq1sPn/2/gNEqUeHu c0t319hKcsiMXMDNnb2hwuO0VolAoGM+ZnpttGpsfOcAA8MQHw84v4wvg5FsK9dbEq8mEL G1GW5QHNAF5fUs0azex/GQKTB684v7g= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=c9DHkc8d; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf18.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.182 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712510340; a=rsa-sha256; cv=none; b=nv85+S/yOobF51sVAL6MGsQvd6ow3hI2RO4MU9uO7NBt9S4X5N67LyCxvBo/EsLWDllnYM 5QKPhViUvMPoN/6P+VDCbKnp0FOlOoBhMgznzsazhsPCjbY9c4Y8dY8gtmVac0W9CtpMn2 Qb7Q+gU/TAzYPq9RZhujy8Km/D3Xj7s= Date: Sun, 7 Apr 2024 13:18:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1712510338; 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: in-reply-to:in-reply-to:references:references; bh=av8DcUEUfW87NIOByp6zq/H9IyJ+V+DhnYtX85sC2lY=; b=c9DHkc8dpZ0wR6BARFRpnU4Zsc9h1rf3ogpwYyvzBXQS/aLbEL9OOkCqxLf6+CFKg9Olmo kmmQOo/CMJBSMBDXs+45PxGQ5IkBBiioOo8tql9ihaVZuJjxlT8OswLWdU4qYtUIWapein ZO8UmQ9/huhgdB2AN4xNCiCGANiFesA= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Klara Modin Cc: akpm@linux-foundation.org, surenb@google.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/memprofiling: explicitly include irqflags.h in alloc_tag.h Message-ID: References: <20240407133252.173636-1-klarasmodin@gmail.com> <55c71868-e2ae-4095-a5ca-5cdb195d508b@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55c71868-e2ae-4095-a5ca-5cdb195d508b@gmail.com> X-Migadu-Flow: FLOW_OUT X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 263271C000A X-Stat-Signature: 8t4kwmb9ebaowed1xtnoc1htkm58bbfr X-HE-Tag: 1712510339-296645 X-HE-Meta: U2FsdGVkX19lmoSu3dLtG/k6VW978f4sDK1k0Q77VzybGBLowIeoaiQM89R9eSSCd2U/Gpl/xgKRHhv8FkgT7HHmT8hC7TAqT5H5YmfSUDwYL+MSdGNyvBTlkrz/Oj/9Ujdoi2/Gf2i18FVhd028u1VKh84r+E5LtP5WG3pJXrFbEvC8/cxWlQT/iVNI/Ub46iq6SmKgrxBugZxDmfBeEtkdd1tKhR1asR5GXJsI3P8iiNDbKwd6g9E71sVVBHmBAKWn88v6WtIuBeOfotl7oOuUJpZsGUvXgXyt6NqSE7rLFRoYW0UfFNUfpBboHK8aOd/j0W7HzDevSYFjZFtfC3kbufthBe6rvCWH7ocicFdZglDkwlc68hhIt19cSAGkj8bvm49/lwBbBr1uu6lALARoY86FNUJFDkdegcVRlRWNENpXyQp5PqSAFv3OcDRAL4Gu/Q0/k4fZtdwIXd/w8qJCz1JSEbeHYASHqEzv+RAKLhZPj7HQZs3LXOnax8EXZt48QXG9nysx1Y6qXoOZ9d933TvmXt1DIj9+K0MN8WVL0TbtWIuVeA21nzOnnksULrSKfSoka9hrXApOSokEQjYukjIxTplj64IJF4ZnUA3nce0vgDCFS3JGLjSjZYoPUyUPWAWC19Qddg4RIU6E6xnEG0yaE2UWUkhYnXiiVgOp0Gx58ZU7ZjBPM5ZpmrqVBlNOU2GSrd8RtOoMTsFaRO9CQLsaUIEQkgmtuUCuoDfsCOaePgGRrEhCb/CYkt38nVch/e081N0bgHCjA555pID8JCJJxGgT9HXBMjYX5yCL/CuCF6awcBGya4eooyUNbhJH/vm96sfguPJCIuSMVtogrCqBukCxHuHWRKv37Xqa2A3rpcycXPQfLE7zV4rJCfYfV4MKfIh8qbzNJ5WHFiSr0iifpKAPFssJ2GtsVU59/NPlOOQYVhE4o54+IJ7y/FXRJcr3Ml0TEthX3fF PYcs6Wtq uIvF2kun5Sh/ZjU6hsMyBqlY4gFfqFn/O07QmgoopePqZ3ql4P1LdW3fmRPhtMoJ3iD8eqkyiPqMJ1jEQqmyNQ8UTEJB3h5zA35x8TW5QKcpwVtL1O9Atssvrz87Okx8O9CmeWCAmWAjw/3F4ZSQ23Q72PHSHi95SIq9Zd4bMJ0erX+tzic3eF8cLZyPkHus9hi+cGjwbeHL+jUwZokaY6L9xCQ== 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: On Sun, Apr 07, 2024 at 07:12:04PM +0200, Klara Modin wrote: > > > On 2024-04-07 19:01, Kent Overstreet wrote: > > On Sun, Apr 07, 2024 at 03:32:52PM +0200, Klara Modin wrote: > > > linux/alloc_tag.h uses the macro this_cpu_inc which eventually expands to: > > > > > > #define this_cpu_generic_to_op(pcp, val, op) \ > > > do { \ > > > unsigned long __flags; \ > > > raw_local_irq_save(__flags); \ > > > raw_cpu_generic_to_op(pcp, val, op); \ > > > raw_local_irq_restore(__flags); \ > > > } while (0) > > > > > > The macros raw_local_irq_save and raw_local_irq_restore are defined in > > > linux/irqflags.h which is not included implicitly on all configs. > > > Therefore, include it explicitly. > > > > > > Fixes: ac906a377c67 ("lib: add allocation tagging support for memory allocation profiling") > > > Link: https://lore.kernel.org/lkml/6b8149f3-80e6-413c-abcb-1925ecda9d8c@gmail.com/ > > > Signed-off-by: Klara Modin > > > --- > > > include/linux/alloc_tag.h | 1 + > > > 1 file changed, 1 insertion(+) > > > > > > diff --git a/include/linux/alloc_tag.h b/include/linux/alloc_tag.h > > > index e867461585ff..afc9e259a2d3 100644 > > > --- a/include/linux/alloc_tag.h > > > +++ b/include/linux/alloc_tag.h > > > @@ -12,6 +12,7 @@ > > > #include > > > #include > > > #include > > > +#include > > > > Actually, shouldn't this end up in a percpu header? Or was there a > > problem with that? > > If I understand it correctly, linux/alloc_tag.h does not include > linux/percpu.h (which has that include) to avoid a circular dependency as > linux/percpu.h includes linux/alloc_tag.h. It instead includes arch-specific > asm/percpu.h, and as a consequence it doesn't always get linux/irqflags.h. > > It's also entirely possible that I've mixed something up, I really don't > have much experience developing for the kernel. Gotcha Acked-by: Kent Overstreet