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=-11.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 19251C07E95 for ; Tue, 20 Jul 2021 07:30:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B2D5E60FEA for ; Tue, 20 Jul 2021 07:30:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B2D5E60FEA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:Subject: From:References:Cc:To:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=vmtYy3Wa8lD/eGnP1+sLtQrQwdlPleCD1NSogVJroAA=; b=Uedr9sHc2u6XlQBwHZDWYl3dHg LSE6D1WHFxxQlRMmxtMMExb3+9srW/UgsYKB0T8F5Owpai5GuZeNINqz81kKj5qlERgim0yGdFA0K r5/6aH0Vpr3md/fymZ+C1NXkCYcdZB9m4oZp5Y/4O+f9h5p0FoRyjtEgQOgdR8ATktzyCIkzHZrke w6bDyXvdaSvn2LB1H6pkYWfeO4dxAw9jsCmTmhHCYIWEN0pXSrrxLLHJOnAlq3JJoj76x8yg086Gv rHxA/GrDki61OEJ7ZmZp8Ki6GeHwJ+V3mFECARz0F1h7emGofybO5YToRlIwCRpuXoe26IdOkXUZG CQJam1UA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m5kBF-00C6E4-8A; Tue, 20 Jul 2021 07:28:41 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m5kBB-00C6Co-0u for linux-arm-kernel@lists.infradead.org; Tue, 20 Jul 2021 07:28:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626766115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kRtDACrxYPJ8ZPr9xqT886xL4OQGjMMieEXBqQ/h2Xw=; b=Pp4PAGvzKKFIdyXSIQfBEWZ/U5PFuXHuf1EcNt5SvyPKWnz13cvAgTog1OK2kdvaqeB1F0 2Wi2KB/YNPLdI+5T/ZiCpiXwgofoDNE+1lPqjNNOyEkd8IdfXpIdY78K7qHX5UjIVicTBk 9AcoJY1wj/s5E88eF0k9UsTb8v7n7sQ= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-190-r_PHe6c8MU6aZE-wNlnAjg-1; Tue, 20 Jul 2021 03:28:34 -0400 X-MC-Unique: r_PHe6c8MU6aZE-wNlnAjg-1 Received: by mail-wm1-f72.google.com with SMTP id b26-20020a7bc25a0000b0290218757e2783so887276wmj.7 for ; Tue, 20 Jul 2021 00:28:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:organization:subject :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=kRtDACrxYPJ8ZPr9xqT886xL4OQGjMMieEXBqQ/h2Xw=; b=tf0ufO7Qz+2iOnLgfcO6KeB3xppCwskOW/twiv8XbGcibxXYRbTkBz1NT6EsCEOiV9 fvz5RPfdyVWyliMoEAyTl0C4W+42y14quZc0NGZuviLN/3qcUnJ4JJuDMvcvoo0aq/8l cihATvkIGsU86n7LoRFBQb0ERXb99jJrHYkQ6dWzmUHCXEJgTGXk1k+7j+FWxxoTjiG1 0HWzeT5QuXw2fVCZMmOg9AXn4Fw/bqNVr0rTWYmmBa/Q1h50FId50/NejhOt9v2yRA/B TiOfB94kmB76x6xVZrupR8yV2fgfdbFqIs6Nz2RxKqMwx5iH4yhouvFVOsj/KbjfUk3G sgMw== X-Gm-Message-State: AOAM531Y5yoS1dccEtGalIaH3RZ7MC4TUN909wsFmZ/MjpmfvZl8Dnqz Ge8ue11V1vBXUddNV1L/ZJ3pce8k4ktLK7bSXUdsUhsmqtefmvdXYXRF6JH2mTHEP1jpVzHsn2C E2wLUz7k07/Uvu6wvXlf4+6DBjMDKY3zNlao= X-Received: by 2002:a05:600c:430c:: with SMTP id p12mr36758986wme.16.1626766113462; Tue, 20 Jul 2021 00:28:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzMxJ6tkE66HwBF8toIqiHp2xtf7yK65y8S1dwets2ANEWlErBZCm5ceoCHkuw+2exOcaa8w== X-Received: by 2002:a05:600c:430c:: with SMTP id p12mr36758942wme.16.1626766113065; Tue, 20 Jul 2021 00:28:33 -0700 (PDT) Received: from ?IPv6:2003:d8:2f0a:7f00:fad7:3bc9:69d:31f? (p200300d82f0a7f00fad73bc9069d031f.dip0.t-ipconnect.de. [2003:d8:2f0a:7f00:fad7:3bc9:69d:31f]) by smtp.gmail.com with ESMTPSA id o29sm17750919wms.13.2021.07.20.00.28.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Jul 2021 00:28:32 -0700 (PDT) To: Peter Collingbourne Cc: John Hubbard , Matthew Wilcox , "Kirill A . Shutemov" , Andrew Morton , Catalin Marinas , Evgenii Stepanov , Michal Hocko , Jann Horn , Linux ARM , Linux Memory Management List , kernel test robot , Linux API , linux-doc@vger.kernel.org References: <20210619092002.1791322-1-pcc@google.com> <30e92457-d540-159c-4c4e-0b8f0d2a1838@redhat.com> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH v4] mm: introduce reference pages Message-ID: <0345cd7b-0196-1c67-6b6c-a5638a66171b@redhat.com> Date: Tue, 20 Jul 2021 09:28:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210720_002837_359235_F2C2FE7F X-CRM114-Status: GOOD ( 21.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org >>> --- a/include/linux/gfp.h >>> +++ b/include/linux/gfp.h >>> @@ -55,8 +55,9 @@ struct vm_area_struct; >>> #define ___GFP_ACCOUNT 0x400000u >>> #define ___GFP_ZEROTAGS 0x800000u >>> #define ___GFP_SKIP_KASAN_POISON 0x1000000u >>> +#define ___GFP_NOZERO 0x2000000u >> >> Oh god, please no. We've discussed this a couple of times already: >> whatever leaves the page allcoator shall be zeroed. No exceptions, not >> even for other allocators (like hugetlb). >> >> Introducing something like that to the whole system, including random >> drivers, destroys the whole purpose of the security feature. Please >> don't burry something so controversial in your patch. > > Got it -- I was unaware that this was controversial. > > Avoiding the double initialization does help a bit in benchmarks, at > least for the fully faulted case. The alternative approach that I was > thinking of was to somehow plumb the required pattern into the page > allocator (which would maintain the invariant that the pages are > initialized, but not necessarily with zeroes), but this would require > touching several layers of the allocator. I suppose that this doesn't > need to be done immediately though -- we can deal with the double > initialization for now and avoid it somehow in a followup. As it's a clear optimization, it should definitely be separated from this "introduction" patch. I agree that the logic for optimizing initialization of a page in this case should best reside in page_alloc.c, for example providing a helper for optimizing the initialization in there. We already pass alloc_flags internally, maybe we can then reuse that to minimize changes. -- Thanks, David / dhildenb _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel