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 X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA7EAC4338F for ; Sat, 31 Jul 2021 17:13:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1F2AB60EB7 for ; Sat, 31 Jul 2021 17:13:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1F2AB60EB7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 4C94F6B0033; Sat, 31 Jul 2021 13:13:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 479B08D0002; Sat, 31 Jul 2021 13:13:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 38F2E8D0001; Sat, 31 Jul 2021 13:13:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0108.hostedemail.com [216.40.44.108]) by kanga.kvack.org (Postfix) with ESMTP id 1EE106B0033 for ; Sat, 31 Jul 2021 13:13:08 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id B65AD1C95B for ; Sat, 31 Jul 2021 17:13:07 +0000 (UTC) X-FDA: 78423528414.24.2C16D2A Received: from smtprelay.hostedemail.com (smtprelay0237.hostedemail.com [216.40.44.237]) by imf11.hostedemail.com (Postfix) with ESMTP id 6C109F0047D6 for ; Sat, 31 Jul 2021 17:13:07 +0000 (UTC) Received: from omf15.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay08.hostedemail.com (Postfix) with ESMTP id 22371182CED2A; Sat, 31 Jul 2021 17:13:07 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf15.hostedemail.com (Postfix) with ESMTPA id 22581C4182; Sat, 31 Jul 2021 17:13:06 +0000 (UTC) Message-ID: <72be13936ca341897d2fd7c65fb4345a8467c571.camel@perches.com> Subject: Re: [PATCH 4/4] memblock: stop poisoning raw allocations From: Joe Perches To: Mike Rapoport , Andrew Morton Cc: Michal Simek , Mike Rapoport , linux-kernel@vger.kernel.org, linux-mm@kvack.org Date: Sat, 31 Jul 2021 10:13:04 -0700 In-Reply-To: <20210714123739.16493-5-rppt@kernel.org> References: <20210714123739.16493-1-rppt@kernel.org> <20210714123739.16493-5-rppt@kernel.org> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.0-1 MIME-Version: 1.0 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX19ko8q83D4fbzHA4YVPHk7tHYLcyeYYJGs= X-HE-Tag: 1627751586-362545 Authentication-Results: imf11.hostedemail.com; dkim=none; spf=none (imf11.hostedemail.com: domain of joe@perches.com has no SPF policy when checking 216.40.44.237) smtp.mailfrom=joe@perches.com; dmarc=none X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 6C109F0047D6 X-Stat-Signature: jp8hdn9s116qr3y8axdr7qsnydgybwqc X-HE-Tag: 1627751587-155764 Content-Transfer-Encoding: quoted-printable 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 Wed, 2021-07-14 at 15:37 +0300, Mike Rapoport wrote: > From: Mike Rapoport >=20 > Functions memblock_alloc_exact_nid_raw() and memblock_alloc_try_nid_raw= () > are intended for early memory allocation without overhead of zeroing th= e > allocated memory. Since these functions were used to allocate the memor= y > map, they have ended up with addition of a call to page_init_poison() t= hat > poisoned the allocated memory when CONFIG_PAGE_POISON was set. >=20 > Since the memory map is allocated using a dedicated memmep_alloc() func= tion > that takes care of the poisoning, remove page poisoning from the > memblock_alloc_*_raw() functions. [] > diff --git a/mm/memblock.c b/mm/memblock.c [] > @@ -1490,18 +1490,12 @@ void * __init memblock_alloc_exact_nid_raw( > =A0 phys_addr_t min_addr, phys_addr_t max_addr, > =A0 int nid) > =A0{ > - void *ptr; > - > =A0 memblock_dbg("%s: %llu bytes align=3D0x%llx nid=3D%d from=3D%pa max= _addr=3D%pa %pS\n", > =A0 __func__, (u64)size, (u64)align, nid, &min_addr, > =A0 &max_addr, (void *)_RET_IP_); unassociated trivia: casting _RET_IP_ back to void * seems odd as the define is include/linux/kernel.h:#define _RET_IP_ (unsigned long)__builtin_= return_address(0) It's probably easier to understand as just __builtin_return_address(0) > @@ -1528,18 +1522,12 @@ void * __init memblock_alloc_try_nid_raw( > =A0 phys_addr_t min_addr, phys_addr_t max_addr, > =A0 int nid) > =A0{ > - void *ptr; > - > =A0 memblock_dbg("%s: %llu bytes align=3D0x%llx nid=3D%d from=3D%pa max= _addr=3D%pa %pS\n", > =A0 __func__, (u64)size, (u64)align, nid, &min_addr, > =A0 &max_addr, (void *)_RET_IP_); here too