From patchwork Tue Nov 10 12:20:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Faiyaz Mohammed X-Patchwork-Id: 11894265 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AC765921 for ; Tue, 10 Nov 2020 12:20:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5DA3B206B2 for ; Tue, 10 Nov 2020 12:20:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="tiZlfPqQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5DA3B206B2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 991B06B006C; Tue, 10 Nov 2020 07:20:32 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 8A42D6B006E; Tue, 10 Nov 2020 07:20:32 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 62F136B0070; Tue, 10 Nov 2020 07:20:32 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0093.hostedemail.com [216.40.44.93]) by kanga.kvack.org (Postfix) with ESMTP id 385166B006C for ; Tue, 10 Nov 2020 07:20:32 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id C9A11180AD801 for ; Tue, 10 Nov 2020 12:20:31 +0000 (UTC) X-FDA: 77468416662.01.bat70_5209efa272f5 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id A4DA5100480B1 for ; Tue, 10 Nov 2020 12:20:31 +0000 (UTC) X-Spam-Summary: 1,0,0,e95c8659eae66d7c,d41d8cd98f00b204,bounce+d06763.be9e4a-linux-mm=kvack.org@mg.codeaurora.org,,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1345:1437:1534:1541:1711:1730:1747:1777:1792:2393:2540:2559:2562:2892:3138:3139:3140:3141:3142:3352:3865:3866:3867:3868:3871:3872:4321:4605:5007:6261:6653:7903:8603:10004:11026:11218:11232:11473:11658:11914:12043:12295:12296:12297:12438:12517:12519:12555:12986:13069:13311:13357:14096:14181:14384:14394:14721:21080:21220:21450:21451:21627:21809:21972:21990:22119:30012:30054:30075,0,RBL:104.130.96.5:@mg.codeaurora.org:.lbl8.mailshell.net-64.100.201.201 62.2.0.100;04y8qq5mymwioin8qo1hktuiwh8p9opzf773rr7z9dfx85rhqjpcafzo557asak.efa1bkj8sbz586e4nnmm8ftk49dxx6jraakx4kq33xq3bcseawioo8yuh6y98io.6-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:67,LUA_SUMMARY:none X-HE-Tag: bat70_5209efa272f5 X-Filterd-Recvd-Size: 4141 Received: from z5.mailgun.us (z5.mailgun.us [104.130.96.5]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Tue, 10 Nov 2020 12:20:31 +0000 (UTC) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1605010831; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=NcClgQULa9ITH6Tn0m0RtnZUGf/0+LsBr9Wi6wpvlDA=; b=tiZlfPqQK8PuxYnt5pZQJ1I++TsMuxY3SrY2EjuX6FF9IFPcFR8fbLLzA80gXDYmdwkyylUg 8RO1agpyprzdgbVrXj0BtsPh/oH2/YB2fbYZlFENBxlk5BZJQVBBf6pbdmBdXH076GlRH32k cTW3cQh2CmYJnwrM1LUQC5+1oug= X-Mailgun-Sending-Ip: 104.130.96.5 X-Mailgun-Sid: WyIwY2Q3OCIsICJsaW51eC1tbUBrdmFjay5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n01.prod.us-west-2.postgun.com with SMTP id 5faa858e11f54ea779bc59be (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 10 Nov 2020 12:20:30 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id EA0E7C433CB; Tue, 10 Nov 2020 12:20:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from faiyazm-linux.qualcomm.com (unknown [202.46.22.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: faiyazm) by smtp.codeaurora.org (Postfix) with ESMTPSA id C594AC433C6; Tue, 10 Nov 2020 12:20:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org C594AC433C6 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=faiyazm@codeaurora.org From: Faiyaz Mohammed To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, rppt@kernel.org Cc: vinmenon@codeaurora.org, Faiyaz Mohammed Subject: [PATCH] mm: memblock: always inline memblock_alloc Date: Tue, 10 Nov 2020 17:50:17 +0530 Message-Id: <1605010817-21065-1-git-send-email-faiyazm@codeaurora.org> X-Mailer: git-send-email 2.7.4 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000364, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Since memblock_alloc is not getting inlined, memblock_reserve owner info is lost. Below information is not enough for memory accounting. for example: [ 0.000000] memblock_alloc_try_nid: 1490 bytes align=0x40 nid=-1 from=0x0000000000000000 max_addr=0x0000000000000000 memblock_alloc+0x20/0x2c [ 0.000000] memblock_reserve: [0x000000023f09a3c0-0x000000023f09a991] memblock_alloc_range_nid+0xc0/0x188 Add "__always_inline" to make sure it get inlined and to get the exact owner of the memblock_reserve. After adding __always_inline: [ 0.000000] memblock_alloc_try_nid: 1490 bytes align=0x40 nid=-1 from=0x0000000000000000 max_addr=0x0000000000000000 start_kernel+0xa4/0x568 [ 0.000000] memblock_reserve: [0x000000023f09a3c0-0x000000023f09a991] memblock_alloc_range_nid+0xc0/0x188 Signed-off-by: Faiyaz Mohammed --- include/linux/memblock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/memblock.h b/include/linux/memblock.h index ef13125..54f9544 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h @@ -404,7 +404,7 @@ void *memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align, phys_addr_t min_addr, phys_addr_t max_addr, int nid); -static inline void * __init memblock_alloc(phys_addr_t size, phys_addr_t align) +static __always_inline void * __init memblock_alloc(phys_addr_t size, phys_addr_t align) { return memblock_alloc_try_nid(size, align, MEMBLOCK_LOW_LIMIT, MEMBLOCK_ALLOC_ACCESSIBLE, NUMA_NO_NODE);