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=-7.0 required=3.0 tests=BAYES_00,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no 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 A21DEC388F9 for ; Wed, 11 Nov 2020 13:29:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F01E2206CA for ; Wed, 11 Nov 2020 13:29:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F01E2206CA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5E2266B006E; Wed, 11 Nov 2020 08:29:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 593D16B0070; Wed, 11 Nov 2020 08:29:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 45B2E6B0071; Wed, 11 Nov 2020 08:29:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0053.hostedemail.com [216.40.44.53]) by kanga.kvack.org (Postfix) with ESMTP id 171A06B006E for ; Wed, 11 Nov 2020 08:29:16 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id B38BA362D for ; Wed, 11 Nov 2020 13:29:15 +0000 (UTC) X-FDA: 77472218670.13.pipe50_0d057a0272fe Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 9163718140B67 for ; Wed, 11 Nov 2020 13:29:15 +0000 (UTC) X-HE-Tag: pipe50_0d057a0272fe X-Filterd-Recvd-Size: 5087 Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Wed, 11 Nov 2020 13:29:15 +0000 (UTC) Received: by mail-pj1-f67.google.com with SMTP id gi3so747002pjb.3 for ; Wed, 11 Nov 2020 05:29:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=dyqXpSq/ETs0u8CiBbSX7eqpqfckYmI3158TguRAUWc=; b=l/7po6bcFTKHNWbl3uPAItjVMdzlgGdfd5MagaO/+Lfmd4kzBKDzpCycR20ay6EIVw 2yvyOwEbx6tNxZAQwv2ENUatS9W4dBUutkAPiH9BVnLHXO9S8wOU0S9ul4ZSA6TjBa14 Px4iZMenCBsZ69RQz3kgq4kGbOyzDWj/b3DzqTryAtqwrToNZaY9GDkCQMsBR+hH3L2G +IQyN9fKkiU7BVQ+EyfIaRhpxkvGlmf4Q9s0AYY3AyNx0w84cbuBIlG0Bv31aHhAT0/t +9x0XwhH9oxh1a1zfcXWllZ3MMr46BovJixn2/yyEUup3s940EfiteBVgcDbALFmyzPw A3yg== X-Gm-Message-State: AOAM53198i4KRAzWjE1n6KsCVUuPHwPSjUG6ybphB/t88+FnFXmb7aS3 pr58IjO7ASGsFQ0BSl//V8E= X-Google-Smtp-Source: ABdhPJyfd0cBH2MaHyAteGa8ksz4vab+NNOANeRNJhS/98ux3YIGeOhmKgAAF7GpnmTVH9AJEN0irQ== X-Received: by 2002:a17:902:c142:b029:d6:ac10:6d25 with SMTP id 2-20020a170902c142b02900d6ac106d25mr21664187plj.37.1605101354112; Wed, 11 Nov 2020 05:29:14 -0800 (PST) Received: from 42.do-not-panic.com (42.do-not-panic.com. [157.230.128.187]) by smtp.gmail.com with ESMTPSA id f17sm2909335pfk.70.2020.11.11.05.29.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Nov 2020 05:29:12 -0800 (PST) Received: by 42.do-not-panic.com (Postfix, from userid 1000) id 060B840715; Wed, 11 Nov 2020 13:29:11 +0000 (UTC) Date: Wed, 11 Nov 2020 13:29:11 +0000 From: Luis Chamberlain To: Vlastimil Babka Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Alexander Potapenko , Kees Cook , Michal Hocko , David Hildenbrand , Mateusz Nosek , Peter Zijlstra Subject: Re: [PATCH 2/3] mm, page_poison: use static key more efficiently Message-ID: <20201111132911.GG4332@42.do-not-panic.com> References: <20201026173358.14704-1-vbabka@suse.cz> <20201026173358.14704-3-vbabka@suse.cz> <20201030162743.GA17058@42.do-not-panic.com> <23a693bd-49cb-99a3-8691-afc74050887b@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <23a693bd-49cb-99a3-8691-afc74050887b@suse.cz> 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 Fri, Oct 30, 2020 at 11:56:48PM +0100, Vlastimil Babka wrote: > On 10/30/20 5:27 PM, Luis Chamberlain wrote: > > On Mon, Oct 26, 2020 at 06:33:57PM +0100, Vlastimil Babka wrote: > > > Commit 11c9c7edae06 ("mm/page_poison.c: replace bool variable with static key") > > > changed page_poisoning_enabled() to a static key check. However, the function > > > is not inlined, so each check still involves a function call with overhead not > > > eliminated when page poisoning is disabled. > > > > > > Analogically to how debug_pagealloc is handled, this patch converts > > > page_poisoning_enabled() back to boolean check, and introduces > > > page_poisoning_enabled_static() for fast paths. Both functions are inlined. > > > > > > Also optimize the check that enables page poisoning instead of debug_pagealloc > > > for architectures without proper debug_pagealloc support. Move the check to > > > init_mem_debugging() to enable a single static key instead of having two > > > static branches in page_poisoning_enabled_static(). > > > > > > Signed-off-by: Vlastimil Babka > > > > > > > > This patchset causes a regression x86_64 as a guest. I was able > > to bisect this on the following linux-next tags: > > > > next-20201015 OK > > next-20201023 OK > > next-20201026 OK > > next-20201027 BAD > > next-20201028 BAD > > > > Bisection inside next-20201027 lands me on: > > > > "mm, page_alloc: do not rely on the order of page_poison and init_on_alloc/free parameters" > > CC peterz. > > I wonder if it's because I converted some static keys to _RO > DEFINE_STATIC_KEY_FALSE_RO(init_on_alloc);. > ... > DEFINE_STATIC_KEY_FALSE_RO(init_on_free); This was along the lines of what I suspected but I didn't have time to provide an alternative. > I thought it was ok since we only enable them during init. But maybe it's > incompatible with use by modules? Not that I immediately see how > drm_kms_helper(E+) uses them. I can reproduce easily so happy to test alterantive patchsets! > Andrew, I'm fine if you drop the patchset for now. I fear the next version > would be tedious to integrate in form of -fix-fix patches anyway... Thanks for this, I confirm next-20201111 boots fine now on kdevops. Luis