Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp934601lqe; Sun, 7 Apr 2024 10:19:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVh9j8SETvDtspAwvC4dFp9/0GaXXaCSaewiPWfc1nLZxZ8WnwXxmKYzV1PDLKwZ8QMkFqXwgGDQ5RA5TqsGxMLVO2V+bOr0Usb8b3EvA== X-Google-Smtp-Source: AGHT+IFMDrzTY9r9wRnKdpXb3ZwjEytqJE7ImIGeElXdnFQiBWvFbDCeuaJ8ACGHIjXcWebTUyZr X-Received: by 2002:a05:6870:819d:b0:22e:bcfd:debc with SMTP id k29-20020a056870819d00b0022ebcfddebcmr7871314oae.13.1712510349544; Sun, 07 Apr 2024 10:19:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712510349; cv=pass; d=google.com; s=arc-20160816; b=KkTp+mlRGdPURznhk+QdaHEBvLdSVCd7y+d6SzB3qA1HjQbQNkfu9TiTopKUaaQ3rO +Z3Zya17GzvzRWXVZwmLws4CTD/MCL/WkM2g7tsVQsrjpzEHUXarUhAShhdNgdkp52Bg 1hVZGTVMPLg4jn6MceXN46S8giYPVF658hg0i4PeneOGlU+RAtzg4rVKBFKAXnjaOM1M /SsCjlKrR60ELjVFh34guuUcfVP+uIoZ0XRqFZkVtTCn/13YFNZcRkzl3TjmL8THBo49 nJ3DXuQ7M1vCvZYq/kQ04X+/qs9t1PyjNnknDymBim9YpIYGovbx2bv4C0WghXSD557L JLKA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:date; bh=av8DcUEUfW87NIOByp6zq/H9IyJ+V+DhnYtX85sC2lY=; fh=bx5XqiAKA83kQ+Inz+WfKnZfmT/bfWGrgkJTudqAMMA=; b=KExwzkZrhMO4UmXvj1ug1klWd5G5Q/ey5OpUio9Q2oqb7r2d62pA1XVTGYxKnAIcub 5+fZmUkQ0zt4lSi7XCuih2+O2kDZ0P52nlI16FNXSdeINeOY/u1yBc0oUzl7x3VPVkRC u8/ze629x5uEuDe3c+5SGJ/4YHUp6KjbXWsQosgmN7e9dCi63nEHLmqllIQ9miShJq6N H93FLJ/gD2s1M+i9ILREgKz8jxYppyLtJfuCtea/7dRJpB/tYrQ5jREJM7b1jOr1rNam oNWQeGstGv1vOPnU+VymE0IQfe4DyRd5ZOSGihPjpRRrL3Lnefg6wB6ieMQHO8awcz6w RkPA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=c9DHkc8d; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-134584-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134584-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id v2-20020a05620a0f0200b0078d496c674asi6877312qkl.331.2024.04.07.10.19.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Apr 2024 10:19:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-134584-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=c9DHkc8d; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-134584-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134584-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 426851C21216 for ; Sun, 7 Apr 2024 17:19:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 361293BB23; Sun, 7 Apr 2024 17:19:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="c9DHkc8d" Received: from out-175.mta0.migadu.com (out-175.mta0.migadu.com [91.218.175.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 436EE374F2 for ; Sun, 7 Apr 2024 17:18:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712510343; cv=none; b=PqmU3DRk8fcXwxGFRhJGsibrIY4VLfAd2e8dbxp1NjAnIwEwcQVT8nwKYx8jhO/RltMqsENm/8DyEQTq2I8FWvan9G9iD7rAjpHlAGzptTaalzC0NLUBkmCRZhUtwTVMqlktR7W1CtwgXtA2YG1Z1a0i9jxZbeGeWDAyY9qpBR8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712510343; c=relaxed/simple; bh=Qrb1ZoVYtz8rZAZsModSkPmvO6pL2nxjjCIkC+M12Ho=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hk5JCTwhZwkDHZ4WQhc+wVT/EB1gw/S5RAVFCTJCSdVGWmdC+xEPxRSBmi+BSz+3PsQoSoq7MgUH8DKEPPEcpJsvXBFJog2JehFUADKud1nk1ZKjStHR+FQ5OFmlt9LeEh9LMI5+bR3E8DLLHwg1j7S2FY46DMhiFdOMSUMvRy0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=c9DHkc8d; arc=none smtp.client-ip=91.218.175.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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