From patchwork Tue Mar 26 07:37:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 13603647 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 B3C1AC54E58 for ; Tue, 26 Mar 2024 07:38:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 03DE66B0082; Tue, 26 Mar 2024 03:38:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F31686B0083; Tue, 26 Mar 2024 03:37:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E1F046B0085; Tue, 26 Mar 2024 03:37:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id D327D6B0082 for ; Tue, 26 Mar 2024 03:37:59 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 57B38A0961 for ; Tue, 26 Mar 2024 07:37:59 +0000 (UTC) X-FDA: 81938386278.17.97EC613 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) by imf25.hostedemail.com (Postfix) with ESMTP id 7FCDCA001A for ; Tue, 26 Mar 2024 07:37:57 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=K45iP1Xt; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf25.hostedemail.com: domain of 3VHsCZgYKCIs796t2qv33v0t.r310x29C-11zAprz.36v@flex--surenb.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3VHsCZgYKCIs796t2qv33v0t.r310x29C-11zAprz.36v@flex--surenb.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711438677; 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: references:dkim-signature; bh=yYWj2Gn9osrAFD6FEND6e5qyKYrw3yLcAlVsmaICSiU=; b=II98rNWUNWEMSPNs79++wBeeKTxeTvfY8M4N6quoF4RAuHJ5ycYpA5VL1mzo43J3Yl+O/s NW9NPHCCrffFOzIwW91zT6fZGxKh86oZrRZfcCMDbohjuvyjAXnO80SmprqLQre+YW92Qh IPbX30AMeTtYbKnuGUT99dbymp06tRg= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=K45iP1Xt; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf25.hostedemail.com: domain of 3VHsCZgYKCIs796t2qv33v0t.r310x29C-11zAprz.36v@flex--surenb.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3VHsCZgYKCIs796t2qv33v0t.r310x29C-11zAprz.36v@flex--surenb.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711438677; a=rsa-sha256; cv=none; b=6YdCYOFSIoeT9j4ohVNvBGt5RyirnP2HHaliY6uoRLfIHGFU9fjMcRlg8V1URG1wB0H60e 6QFOEQ6AJGyHo7Hoel+36vXKpN9Hv6wdz7bXV6B6eDwyvs+1Hf/627uqzVbrFz1p1YMCDI 0Mz7/7kp/JaKn4gLotQDa3oFaskGRmY= Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-60a03635590so105406827b3.0 for ; Tue, 26 Mar 2024 00:37:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1711438676; x=1712043476; darn=kvack.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=yYWj2Gn9osrAFD6FEND6e5qyKYrw3yLcAlVsmaICSiU=; b=K45iP1XtFd4SSfNLp5oRpu5x2bsbs8NtwkrY/GI5hXeMq41Z90XOfCXHIFIqoLOXmz lBBBAaDN2FummvOtFnajN4erZghjEHj2BjngxBcFMFUCTohGoq+LN1TXBgYa33FBOA1t hl9xwTIL/y7kE69GX581LEOeUeGTyDgwSUBfFS+9Dpe8lDfPIEI/E17sMvxyvZsB6U++ TD8/WhFna5DG5/r8LKgMBMy0uzqBnBILdCV3fJWhphhelLuFnVx04hMnIcJOBfBVG12k zm3VztE3CNH2mDC4TwvvmwN9TSdwV91fGjTfzsSgSCGRHPIj9MFEi+Nws9CBX9GKAI0r KI1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711438676; x=1712043476; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=yYWj2Gn9osrAFD6FEND6e5qyKYrw3yLcAlVsmaICSiU=; b=m3QqYG98RxbNRterCXk6Uk7H75hojCTudwmCAXpeolf37iHmlxfc8WW7VtDsooTsO2 o5hsXKLGdN4i9q2cCtx/eQCqTjWuXDuLhalHMI6f1lTNalh7JP9/6r24v6XKeOVJTa/L wBvP/76eNMJY4yJsGPkv4JiTCPYo1gmnm7/4cS538JFNYmLeYQBvbZiiZEMXuNY2VyrB 2uf+l5Fg1eRhRP5OM8hR9RPBY9kURMvmI5APagNVWI0XsUwKf1CIYPDv1DxI4Q4VqHCp brdL/LhPpZrJmXSNK6mZozqAhIy6gVvTnw9LbWLTqRaAGWlu/xFliLqVVGNGY7Vuu3TG 838g== X-Forwarded-Encrypted: i=1; AJvYcCVgFHWhEtKVun0OK9KQgLAOJE282v5GFChbdpoePGEq9/w+4ViPbT/5qqSugRxK+gKE9Uh9LMyUm+hR6G/jWaikDXA= X-Gm-Message-State: AOJu0YxN8rO4r1oyu1P18nFMmp3xfMOQUqflpRW1gd3PHu01eNOQtt5E P/20CzlfYHXk4rgSLLHdMMg7P/vwdXFXnVK/aSO4eXUAkVqXBOjLI54HNylnBca4MOWJeT7PDtW w7w== X-Google-Smtp-Source: AGHT+IGPHjQo87+r2zhqmR6kCCDNQTsYC+f2ZCJS3JAQtG++EJPcIBJevN+jcis5On9vmS24q4aOrBZ/Y3Y= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:201:f77:52ef:ebeb:2cec]) (user=surenb job=sendgmr) by 2002:a05:6902:100a:b0:dc6:ff2b:7e1b with SMTP id w10-20020a056902100a00b00dc6ff2b7e1bmr2849789ybt.4.1711438676435; Tue, 26 Mar 2024 00:37:56 -0700 (PDT) Date: Tue, 26 Mar 2024 00:37:50 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.44.0.396.g6e790dbe36-goog Message-ID: <20240326073750.726636-1-surenb@google.com> Subject: [PATCH 1/1] arch/um: fix forward declaration for vmalloc From: Suren Baghdasaryan To: akpm@linux-foundation.org Cc: sfr@canb.auug.org.au, kent.overstreet@linux.dev, sj@kernel.org, richard@nod.at, anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net, surenb@google.com, linux-mm@kvack.org, linux-um@lists.infradead.org, linux-next@vger.kernel.org, linux-kernel@vger.kernel.org X-Rspamd-Queue-Id: 7FCDCA001A X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: u7jw7gg7ayksi1yrkrd1tc4rtrenwr35 X-HE-Tag: 1711438677-414553 X-HE-Meta: U2FsdGVkX1+jqDkqU89pdbkOV06hEvgMh26k9yDQeQcLMJsXRnTFDHJluevlFFiVWs4jTZtvlWHw7q3yzB8z6Dj8Ui4EEX67mtP/8j1reyEMsSLvg+A/JKsl4moPYg6QTLRMoW07yknG2IubFzVKH0+vkTZLC0K68I3xwc4apmTv1l9+HGULgIha73UPkqCqX2rXFeARoDTpjIlTgMoxhk/UunKenuTxRxifuWuIGXTqMN6jYh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5Fh1aTi0rGBRIUW77Cu8V+WqWQxZtbCzgC+E61QlFmKDHs1nvUsY7vZp+OuvXNve/f15Vc/DWLVoc/KIOp0uBc9soyxtzkLFWI28a89cjsSDhVZzV1sLYboRSf0QyxFRcIi3x0JX5ABxd6akH8hAfwLT2sesJbePUcU2bmkG43f9JOjwl4/oXWDTCanrpW320vt6+7Fpsm2SEnc/t1u9/dtONxqHBJM72g+JasMpmfjTq8aP77xZg9AB09fgi2d6K17iqwEBA4nTo9fBdifQZB0FyExxwuOL3FCTkkpqiUaklCDn+cXFuL2hg7M5Y7ejPrl3bDBtT+epWEK X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Patch [1] replaced vmalloc() function with a new definition but it did not adjust the forward declaration used in UML architecture. Change it to act as before. Note that this prevents the vmalloc() allocations in __wrap_malloc() from being accounted. If accounting here is critical, we will have to remove this forward declaration and include vmalloc.h, however that would pull in more dependencies and would require introducing more architecture-specific headers, like asm/bug.h, asm/rwonce.h, etc. This is likely the reason why this forward declaration was introduced in the first place. [1] https://lore.kernel.org/all/20240321163705.3067592-31-surenb@google.com/ Fixes: 576477564ede ("mm: vmalloc: enable memory allocation profiling") Reported-by: SeongJae Park Signed-off-by: Suren Baghdasaryan Tested-by: SeongJae Park Reviewed-by: Johannes Berg --- arch/um/include/shared/um_malloc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/um/include/shared/um_malloc.h b/arch/um/include/shared/um_malloc.h index 13da93284c2c..bf503658f08e 100644 --- a/arch/um/include/shared/um_malloc.h +++ b/arch/um/include/shared/um_malloc.h @@ -11,7 +11,8 @@ extern void *uml_kmalloc(int size, int flags); extern void kfree(const void *ptr); -extern void *vmalloc(unsigned long size); +extern void *vmalloc_noprof(unsigned long size); +#define vmalloc(...) vmalloc_noprof(__VA_ARGS__) extern void vfree(void *ptr); #endif /* __UM_MALLOC_H__ */