Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp355711pxb; Wed, 11 Nov 2020 05:33:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJznBF3Ky9SJWQ6PZR6+3D7Fab89FeN398Fq0BjnidZs7y7p7JVfNQ2zlvLASKoZ2KNmX0fo X-Received: by 2002:a17:906:f1d8:: with SMTP id gx24mr24977656ejb.73.1605101611277; Wed, 11 Nov 2020 05:33:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605101611; cv=none; d=google.com; s=arc-20160816; b=xllKHqd/hSOQfqppxR9HknkzOvsEb2D+nrV39fP+w3n9An5c0tPpTp9T92c4S4q+1H xGv5EsdO//tLe0GpsnXgRsXVVW1bwGaoCqYH1fghUjRw6aTAHbeyBImla8SKtqeScxSH rBInPx3kqytGRg++gr8IKxZAnZ2VyAo762e78UsGGLz8euHyF0KTWGafQQbLtk8LldTp l8JGt08lii7cYATN5TitE7SUqqPX0kZy8E4sIzmBfnEaMsPxeQgnNIEH/R9p7vqOt/9d UHtGYxwHGyAZp3hYB/e8FQ7slC40CVB5gY5f9ogB2+QxwZ12uwMQlg8E0NxP0fJ/Xopu dYcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=dyqXpSq/ETs0u8CiBbSX7eqpqfckYmI3158TguRAUWc=; b=wXqv3vH7dhNqGJ0ygZPkvIWdlT2L1Kll3nwdjVHeYMD2Gxaa+q88G3br22QlfXdFKi hk98QrYVBgwX3NW027EUAbB1oFUjwNJ3/2veye53XWgtmV0X0c7wz0P3qfmqRcn1kF+2 nXwwaS7PhnUfzDrZykVNgVxVJYZwpkhl2E4FW4cQAjcvSMaS1eSZYXOFokR9eRUaQqix uVDqInReNUt9Vot42s2MqIt3QPu3Vk1lDXX9EBLBHRXuaMBoQCMCfEsAQB7ywOattDz2 ncFXt1LyZesOf3jw7LPr+ibAEOctIntZsPvg9yx1SWi3rBOZzeWFiPdRg/3S5BR3RRWt gU+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t6si1289625ejf.462.2020.11.11.05.33.00; Wed, 11 Nov 2020 05:33:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726012AbgKKN3Q (ORCPT + 99 others); Wed, 11 Nov 2020 08:29:16 -0500 Received: from mail-pj1-f67.google.com ([209.85.216.67]:55384 "EHLO mail-pj1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725900AbgKKN3Q (ORCPT ); Wed, 11 Nov 2020 08:29:16 -0500 Received: by mail-pj1-f67.google.com with SMTP id r9so703312pjl.5 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=oe15BqSjSbACDdDgh8AAI7TAkWGQJB9b+F6ALYtL2EOG4axZbS9Bj36zkPElTTOXvE 2a/iRdXdKNcgHhmG0ro8FsWR/mmICyuZ1bG1FUhoL3F1/T6UZQ01isRkzcHtdJIkgWoC 4SeXgdBLpLyBbbG68McQXQZ72nFkxVyec3DpF3NmVi/WFdzGHP2LeY2YfwMLbaQlKJ7P 5+SAAvNf6qCPFP/jKUtF6kwg9wHIRfU7M4FlRIDM9s0jhtd/2IytygybGQndp5rkdO9r i1UWb9mnkUsMlSulLDeqYDKIZlX5hKOlXozt7C3KKLSuAfwwa+PzfuI8w1z5wUIvEyXL AApA== X-Gm-Message-State: AOAM5332WRlzveOufH0S0JKl+7dRFcVIwgK5rm/4HYRo/oJkoIRbo2v0 MTUlEPY59xxrsW0xqmd1zUI8QGs+EyxFSA== 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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