Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp1034129lqh; Fri, 29 Mar 2024 05:27:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVcbH7SWqN6bNGB5qDBJI+ZrjQFyFzq6FvsRekwyse2WZXXlcbxC71w438KLNo5to8K37/AoHAZCWE2NMV9rhd/TS4vvRXiFI2EoG2Buw== X-Google-Smtp-Source: AGHT+IEFmiJaoCopHuPkz/nta5N8+ESjO4lVEExIjdKMUKw8LJWyQKRfvBecVJh2LnkP3+snQRlV X-Received: by 2002:ac2:5495:0:b0:515:c960:1d32 with SMTP id t21-20020ac25495000000b00515c9601d32mr1277986lfk.39.1711715250678; Fri, 29 Mar 2024 05:27:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711715250; cv=pass; d=google.com; s=arc-20160816; b=EMVKGiXWKTEFI2DuCSlWH5cMtoqFeXsaaokFLy+eDtZF/JvdwqeIXXNIOmDPTyOnt9 PhWtpayf/QWxBzgzM6PASFMHAN8oX87awVK5ByHKVQH05997yjSTR/7xtUidaIvaR57C qs32V9dA0sco41g4BZ72ujnpP4PSzdrH0B8o5faIQrgU0V3OOPn4bxWWWV1R8GnPucjK mxLkUQe32SFR+y1BJfTzZi2c5MHKPl5zHfx1MfTNd3IJmh4dsGjF26lgPyGkBhJLjUxF o97Kh7fbYush8hOIfIg0yu089l7yUFjJQzqfciBHJRdz2vfpPglLUyzsbqHpKe9UxH2C n/TQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ZKa+ASXdo1cZjsSafEP2q+atVyr7ARDRo2pQvhN/Kj0=; fh=1qFiqC0cmHQ0xIuJMWkFPZqgSXpeN2rSsw1ZqlWFRxI=; b=w44cHttIjWsoCWFiRtxXLE7VLAZOHMXTU3K5EcrG4Ys51gDuKesztQ+W8FePj9kQRT rEowciSzwXQHRxKxZp5gKLPoEClPLzaFBqhKvB7VMbto7xrZGrwsBMgarhqu0s2Mi3kk hLL2u2NoEPkOOuWPqwMCEN/T9newEoL0uadQJ3KpHBsifd/gQSKk683vYWtMt+ielCGE oVHKm/oPO4AzkgQXkmDAOZZEDRRXfq5RAG7jFchIi5se4KuPcs+S+hHTAebhAhMGcx1F q2SLD7InDp8RM37HO6aNnnDVDagB76a4uAnrvb7wUbTtyNR/GPRM/oUXSwTPKT9MREAp UZXw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=d1xEhmSz; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-124481-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124481-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id j4-20020a170906050400b00a43db2d8b90si1692825eja.325.2024.03.29.05.27.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 05:27:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-124481-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=d1xEhmSz; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-124481-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124481-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 54F371F21317 for ; Fri, 29 Mar 2024 12:27:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E0B2A86128; Fri, 29 Mar 2024 12:26:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="d1xEhmSz" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B70312DF9D for ; Fri, 29 Mar 2024 12:26:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711715211; cv=none; b=Ok1O2fHB4jP8whNL2H/RlvrEaGDbkDcme1/B3ybVz85fiDi+Q+eWilIIdJPO6Bojqq0372zb2NANicwr9thsxoEhHOkeH7DYqCMMcqYSJh1mUuE6Zjtt67blq2yD1+EgTb/cUMQ29Jc8aJmCHeBBzdmg4QkwxK7iOhUhVLfuwdI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711715211; c=relaxed/simple; bh=6GKVduxyKft6+aqo8OJZghbXgEyFPiqU0To2JY0hPLg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=u0j+2gqHqRsanVDiEHCks9GEffBJ9IyDnOXZsMKh02S52xd3/ULCmSXciZpLWYzMjnfjuTLTxraqENs1y16xmPo5U7+pEe9tBViJ4DG7Ae58jR/01TDbPtcrEGbnIlhSmzXZd6serxoJ8IoVgX9c5vRe8/XhTVfM/JsHb4gkonM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=d1xEhmSz; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ZKa+ASXdo1cZjsSafEP2q+atVyr7ARDRo2pQvhN/Kj0=; b=d1xEhmSzYPQMlBB7Oof3HhACB1 spkoUuyRBhnjM9/BbRPGJTaLRqMwsVxf7ZBMADJaQWAswuXN8klCNAAIx/Tv95NQuPg+4danNJMpB RZwqBdDFTJDJLE++WqaP+SDSGHiuIQjuDSWnjfqqsY9J5Jd28vVoiU0xXM3DR5w+dOYMFls6j5rLk 1AswbXOAxluDebsTh2TxgAdgRPWCq4YYMAe2iaxTuZYBiS7TqZFr8ayWqntIc6mjhstgH6aQpnbJT cnqQfJuHv4K6uc9nCRG8zsXe6MnTR61rMEJOAJ+7Zz1zVJcpRyGEBhotZ92kIf0e4Mv0mNUMCHwoY 1Z4LuMsQ==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rqBJm-00000009Ar6-1nL2; Fri, 29 Mar 2024 12:26:46 +0000 Date: Fri, 29 Mar 2024 12:26:46 +0000 From: Matthew Wilcox To: York Jasper Niebuhr Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, willy@linux.intel.com, linux-mm@kvack.org Subject: Re: [PATCH] mm: init_mlocked_on_free_v3 Message-ID: References: <20240329115446.424923-1-yjnworkstation@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240329115446.424923-1-yjnworkstation@gmail.com> On Fri, Mar 29, 2024 at 12:54:46PM +0100, York Jasper Niebuhr wrote: > + if (want_init_mlocked_on_free() && folio_test_mlocked(folio) > + && !delay_rmap && folio_test_anon(folio)) { > + kernel_init_pages(page, 1); Confusing indentation. One of these two options: if (want_init_mlocked_on_free() && folio_test_mlocked(folio) && !delay_rmap && folio_test_anon(folio)) { kernel_init_pages(page, 1); if (want_init_mlocked_on_free() && folio_test_mlocked(folio) && !delay_rmap && folio_test_anon(folio)) { kernel_init_pages(page, 1); Also, '1' is incorrect. Should be folio_nr_pages(folio). > @@ -2559,12 +2570,21 @@ static void __init mem_debugging_and_hardening_init(void) > } > #endif > > - if ((_init_on_alloc_enabled_early || _init_on_free_enabled_early) && > + if ((_init_on_alloc_enabled_early || _init_on_free_enabled_early > + || _init_mlocked_on_free_enabled_early) && > page_poisoning_requested) { Wrong indentation again. I'm not going to point these out every time, just fix it throughout.