From patchwork Thu Apr 9 09:40:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaewon Kim X-Patchwork-Id: 11481501 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 8D7B4913 for ; Thu, 9 Apr 2020 09:41:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3C81221D92 for ; Thu, 9 Apr 2020 09:41:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="Kbnu945v" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3C81221D92 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 700F78E000D; Thu, 9 Apr 2020 05:41:15 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 6B15B8E0006; Thu, 9 Apr 2020 05:41:15 -0400 (EDT) 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 5C77E8E000D; Thu, 9 Apr 2020 05:41:15 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0074.hostedemail.com [216.40.44.74]) by kanga.kvack.org (Postfix) with ESMTP id 4A61C8E0006 for ; Thu, 9 Apr 2020 05:41:15 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 22125C5AC for ; Thu, 9 Apr 2020 09:41:15 +0000 (UTC) X-FDA: 76687823310.09.road16_27dc8f8674907 X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,jaewon31.kim@samsung.com,,RULES_HIT:30054:30075,0,RBL:203.254.224.24:@samsung.com:.lbl8.mailshell.net-64.10.201.10 62.18.1.2,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:223,LUA_SUMMARY:none X-HE-Tag: road16_27dc8f8674907 X-Filterd-Recvd-Size: 6955 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by imf06.hostedemail.com (Postfix) with ESMTP for ; Thu, 9 Apr 2020 09:41:13 +0000 (UTC) Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20200409094110epoutp0137c058ff06fc35ad37121b695c37c6e3~EHWDCsDo-2291022910epoutp01r for ; Thu, 9 Apr 2020 09:41:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20200409094110epoutp0137c058ff06fc35ad37121b695c37c6e3~EHWDCsDo-2291022910epoutp01r DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1586425270; bh=hYOGH5QzXR9eOJyz65hhkK+8y7rMO7Q72pB3emsDqBc=; h=From:To:Cc:Subject:Date:References:From; b=Kbnu945vdA1AlwdyCr75hNjp2ZPIoLgVYAQweZ/NpC2oZXShDic+4XtpA9hB0urit VD7ADAcWWImD3iNXmzSKwdItJVOL0VpVMbjFWEqE5iUzoNSd4+pr6s3PriM6jfhaVd CPaeQ/CoCYArgObageMhlWAZ4zPAhBjfEGqxSaa8= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20200409094109epcas1p463018479d21645ca68dadc15c6fd2c0e~EHWCrmu1f2551725517epcas1p48; Thu, 9 Apr 2020 09:41:09 +0000 (GMT) Received: from epsmges1p2.samsung.com (unknown [182.195.40.163]) by epsnrtp1.localdomain (Postfix) with ESMTP id 48ybkC2vnNzMqYls; Thu, 9 Apr 2020 09:41:07 +0000 (GMT) Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmges1p2.samsung.com (Symantec Messaging Gateway) with SMTP id EF.1E.04544.3BDEE8E5; Thu, 9 Apr 2020 18:41:07 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p4.samsung.com (KnoxPortal) with ESMTPA id 20200409094106epcas1p4ab88dab9bddc5c2c40fca2bcbece3b17~EHV-9zi6u2865028650epcas1p4L; Thu, 9 Apr 2020 09:41:06 +0000 (GMT) Received: from epsmgms1p2new.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200409094106epsmtrp1c525a99a6ad794aa28f9f1d7e9b2ea83~EHV-89LIx0118101181epsmtrp1F; Thu, 9 Apr 2020 09:41:06 +0000 (GMT) X-AuditID: b6c32a36-7e7ff700000011c0-46-5e8eedb3f279 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2new.samsung.com (Symantec Messaging Gateway) with SMTP id B2.3C.04158.2BDEE8E5; Thu, 9 Apr 2020 18:41:06 +0900 (KST) Received: from jaewon-linux.10.32.193.11 (unknown [10.253.104.82]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200409094106epsmtip18b9418a6856bcd27593376af15aa22c9~EHV-xcjo42924329243epsmtip12; Thu, 9 Apr 2020 09:41:06 +0000 (GMT) From: Jaewon Kim To: willy@infradead.org, walken@google.com, bp@suse.de, akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, jaewon31.kim@gmail.com, Jaewon Kim Subject: [PATCH] mm: mmap: initialize align_offset explicitly for vm_unmapped_area Date: Thu, 9 Apr 2020 18:40:35 +0900 Message-Id: <20200409094035.19457-1-jaewon31.kim@samsung.com> X-Mailer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Ik7Mi46ASS3FGoqEWc1FxIgDyX343fgMA AA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprGLMWRmVeSWpSXmKPExsWy7bCSnO6mt31xBts/61jMWb+GzWJiv6ZF 9+aZjBa9718xWVzeNYfN4t6a/6wW/ybVWvz+MYfNgcNj56y77B4LNpV6bF6h5bHp0yR2jxMz frN49G1Zxeix+XS1x+dNcgEcUVw2Kak5mWWpRfp2CVwZJ/eFFkzjqfh6uZO1gXElVxcjJ4eE gInEtNbHbF2MXBxCArsZJb5d3ccMkZCReHP+KUsXIweQLSxx+HAxRM1XRom5+34xgtSwCWhL vF8wiRWkRkQgXGLq9gqQMLNApcS/27dYQWxhgSCJvpl7GEFKWARUJU7cUQYJ8wrYSvxt7mOF mC4vsfA/8wRGngWMDKsYJVMLinPTc4sNC4zyUsv1ihNzi0vz0vWS83M3MYJDS0trB+OJE/GH GAU4GJV4eCX298YJsSaWFVfmHmKU4GBWEuH1bgIK8aYkVlalFuXHF5XmpBYfYpTmYFES55XP PxYpJJCeWJKanZpakFoEk2Xi4JRqYMxVWb3y6/pLt63cOx8wNa5bxlXlv95qbXbonT9rmBIb N/42DP5ULLD65v/zDzpO+ssz7yo0mnKk2zbppuG9WucZZ+brTuRx0WyQyE9T5dLnne3oG31w V6raD/lHc9dNN/Occvn7e7kbz9ovLJ48t/peV0DAP6Nb+5hPXzlzmbvgYI7juj+sOXVKLMUZ iYZazEXFiQBW7JP+KQIAAA== X-CMS-MailID: 20200409094106epcas1p4ab88dab9bddc5c2c40fca2bcbece3b17 X-Msg-Generator: CA X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20200409094106epcas1p4ab88dab9bddc5c2c40fca2bcbece3b17 References: 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: On passing requirement to vm_unmapped_area, arch_get_unmapped_area and arch_get_unmapped_area_topdown did not set align_offset. Internally on both unmapped_area and unmapped_area_topdown, if info->align_mask is 0, then info->align_offset was meaningless. But commit df529cabb7a2 ("mm: mmap: add trace point of vm_unmapped_area") always prints info->align_offset even though it is uninitialized. Fix this uninitialized value issue by setting it to 0 explicitly. Before 92.291104: vm_unmapped_area: addr=0x755b155000 err=0 total_vm=0x15aaf0 flags=0x1 len=0x109000 lo=0x8000 hi=0x75eed48000 mask=0x0 ofs=0x4022 After 68.584210: vm_unmapped_area: addr=0x74a4ca1000 err=0 total_vm=0x168ab1 flags=0x1 len=0x9000 lo=0x8000 hi=0x753d94b000 mask=0x0 ofs=0x0 Signed-off-by: Jaewon Kim --- mm/mmap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/mmap.c b/mm/mmap.c index 8d77dbbb80fe..de07bbc0e21f 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2123,6 +2123,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, info.low_limit = mm->mmap_base; info.high_limit = mmap_end; info.align_mask = 0; + info.align_offset = 0; return vm_unmapped_area(&info); } #endif @@ -2164,6 +2165,7 @@ arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr, info.low_limit = max(PAGE_SIZE, mmap_min_addr); info.high_limit = arch_get_mmap_base(addr, mm->mmap_base); info.align_mask = 0; + info.align_offset = 0; addr = vm_unmapped_area(&info); /*