Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3905798pxf; Mon, 29 Mar 2021 15:08:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfNkFs7+uIRRgWpk2v4K6xm+pvNIaZ0wZOEaZLoLzP8U+uJ3P/xXz8XyunpxGZHjTWHPNH X-Received: by 2002:a17:906:3388:: with SMTP id v8mr30970864eja.278.1617055716343; Mon, 29 Mar 2021 15:08:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617055716; cv=none; d=google.com; s=arc-20160816; b=ptdaYsy4ouZiMdqhBaNbGembkGqH5PYaBm5oWjoBjRMjWGB250DIWF07S86mpvogIH rZ/AcvAs312i5xPNceEnG/72zSGTKqJSrE5rBtX8vo9MKauE4YlVfP5Aeii6SfEUNtZc 2HXK/8JlLjk4+AeGLMmGUiYthSwjpbVW5FdslkIMChRFL5quXXb3J4J6kDbqiNmuPkpI TFRJ4WUnLCxQXYZF0bM71iUAIKgZmmvJrr9+P1lVsBMPcH5KLNOh7sPLX0rHtPit5OR0 CDa5iODSP6NMBq2ulTWyjsbUMhqMra6uGFi3C71hCD3zD6iNMFI9Vd5bgog4AKxIVa8g ft1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=aEYe7bkD8Ds4SJUfXNgyngBuOtl2YbTpmEi3Zdkm2E0=; b=oZV+czdxX5kQSpLC2fPSbWTj3kAlj6kT87SmCBcw12pjMKUEtrUrWZXghlSiS5IcV2 Qi9qISJgM2ujbBtrmGJVhA60E3JHYM99cWkqiTkf9ZCm6uzdKIoDsVFBjf2UiG2vmVpL 1EOIRWMs0AW6oDWxUMpbdLpjFQsc3bUWK/33We24hE839FLd6vDrUvksrMiGWWHNQn7H LcWB9kvEyUtAApjRbrd7bD7mpYhZFiKyAcjAtn5lzCT7khBTDM76jKMBluVSGKW9bErW hF6y0lsS8qVkzNWhmPQV/nReDqOTfsEYzJ4btjT5uoKa7pfc//Ry+2o2ZMo0oEbbp3+s LgVw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d19si14310775ejp.154.2021.03.29.15.08.13; Mon, 29 Mar 2021 15:08:36 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231270AbhC2WHL (ORCPT + 99 others); Mon, 29 Mar 2021 18:07:11 -0400 Received: from mx2.suse.de ([195.135.220.15]:52166 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231543AbhC2WHH (ORCPT ); Mon, 29 Mar 2021 18:07:07 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 3AA84B138; Mon, 29 Mar 2021 22:07:06 +0000 (UTC) Subject: Re: [PATCH] mm: page_alloc: ignore init_on_free=1 for page alloc To: Andrey Konovalov Cc: David Hildenbrand , Sergei Trofimovich , Andrew Morton , Linux Memory Management List , LKML References: <20210326112650.307890-1-slyfox@gentoo.org> <4e23d404-5125-6c9c-4aa7-5eff0fa1ba33@redhat.com> <469d6417-64a5-fe99-1214-bb0351833b74@suse.cz> From: Vlastimil Babka Message-ID: Date: Tue, 30 Mar 2021 00:07:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/30/21 12:00 AM, Andrey Konovalov wrote: > On Mon, Mar 29, 2021 at 2:10 PM Vlastimil Babka wrote: >> >> > commit 855a9c4018f3219db8be7e4b9a65ab22aebfde82 >> > Author: Andrey Konovalov >> > Date: Thu Mar 18 17:01:40 2021 +1100 >> > >> > kasan, mm: integrate page_alloc init with HW_TAGS >> >> But the mmotm patch/-next commit also changes post_alloc_hook() >> >> Before the patch it was: >> kernel_unpoison_pages(page, 1 << order); >> ... >> kernel_init_free_pages(page, 1 << order); >> >> Now it is (for !kasan_has_integrated_init()): >> >> kernel_init_free_pages(page, 1 << order); >> >> kernel_unpoison_pages(page, 1 << order); >> >> That has to be wrong, because we init the page with zeroes and then call >> kernel_unpoison_pages() which checks for the 0xaa pattern. Andrey? > > It's similar to free_pages_prepare(): kernel_unpoison_pages() and > want_init_on_alloc() are exclusive, so the order shouldn't matter. Am > I missing something? Yeah, when the allocation has __GFP_ZERO, want_init_on_alloc() will return true even with the static branches disabled.