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=-2.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 54AA6C32751 for ; Wed, 31 Jul 2019 08:58:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2D0532089E for ; Wed, 31 Jul 2019 08:58:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gz4EhWDw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727611AbfGaI6Y (ORCPT ); Wed, 31 Jul 2019 04:58:24 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:46972 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725970AbfGaI6Y (ORCPT ); Wed, 31 Jul 2019 04:58:24 -0400 Received: by mail-io1-f67.google.com with SMTP id i10so21273480iol.13; Wed, 31 Jul 2019 01:58:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=GsMyYZltyVkiUgPix6eZw4DKTyNFfETnvHB4Ds8HiVc=; b=gz4EhWDwl+FFka+bG6XuRSE2IyaGBW8Ek0wnAE7rVPcqqyMm9VkwrweV7mrXFgGZFx UMGO14B2lr7QR+QJ3Qkw83KZeXJInnnyoZT/nJmWEJSYN+GJPM8Ssn8Lo92YDFitn9t8 aaxjgS0ZGVxjVV29XHmzYtu1x5on8Mm+EaHMNfm6dpjHsjDs3ZDJ1/sSPCnF7oZk5hwo 5Kgo/j+dnAG6hVjaTWGjGNemZBE+eK0sVm+UKYDnEVCBERmON9sxvDm11nMwfbIAeySH R9VXdXpyGI3BkYZyYW3PP8oC+QryXwmY8U+X4kHJHnvjo8cTnPEeoNRtZlljs1HrxI3R Xnew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=GsMyYZltyVkiUgPix6eZw4DKTyNFfETnvHB4Ds8HiVc=; b=EtaewPSEwWECnjNVMkyoWmJUeCdkzls7j4SxuQRGsWQleiRny/jqI0t3840QO5cuyv hAaLaL0GFaWS8QHRv4Cr7Az4CrdIDXaVK8cZx78gEsbzw3uFvc/FldI1bUktkTN35yxo 9p5MsC70idHcVej79GamUqn88AS4j7BFe7LRUJhVkRb/IBAojcCVj8bvKXdhgdtCSKX2 F9Wkqu7hW9XH00JYAiKAoYZi/vUJVgcR/u1CtP/CoqjcJGETBIvDwqQk///tYHDZxxPd d20m0rL+Kxf7GObaeLdR9xBsgVEazWag5E88TtaxnhiSvMaPIHEcyO9couaLjptxKoY4 ji0Q== X-Gm-Message-State: APjAAAU77XiFJBHBe7NIzl2AgC6z6Flc8Iyu6iLdSGo+ATWMHsfBr3El dSqRLx3CwG0Pcyyxuy3QsSA= X-Google-Smtp-Source: APXvYqzm+BH7xQRpT+4ezKyy3jdxNDHBrI0ptlr0nsU0f5AZPXTwXFCEtdwxbp5e6xwz8i9BWOTuyw== X-Received: by 2002:a5e:924d:: with SMTP id z13mr24840346iop.247.1564563503597; Wed, 31 Jul 2019 01:58:23 -0700 (PDT) Received: from localhost.localdomain ([2601:285:8200:4089:3dd3:8aa0:5345:aaa3]) by smtp.gmail.com with ESMTPSA id a7sm54226200iok.19.2019.07.31.01.58.22 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Wed, 31 Jul 2019 01:58:22 -0700 (PDT) Subject: Re: [PATCH v3 0/2] mm,thp: Add filemap_huge_fault() for THP To: Song Liu , William Kucharski Cc: lkml , Linux-MM , "linux-fsdevel@vger.kernel.org" , Dave Hansen , Bob Kasten , Mike Kravetz , Chad Mynhier , "Kirill A. Shutemov" , Johannes Weiner , Matthew Wilcox References: <20190731082513.16957-1-william.kucharski@oracle.com> From: William Kucharski Message-ID: Date: Wed, 31 Jul 2019 02:58:21 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/31/19 2:35 AM, Song Liu wrote: > Could you please explain how to test/try this? Would it automatically map > all executables to THPs? Until there is filesystem support you can't actually try this, though I have tested it through some hacks during development and am also working on some other methods to be able to test this before large page filesystem read support is in place. The end goal is that if enabled, when a fault occurs for an RO executable where the faulting address lies within a vma properly aligned/sized for the fault to be satisfied by mapping a THP, and the kernel can allocate a THP, the fault WILL be satisfied by mapping the THP. It's not expected that all executables nor even all pages of all executables would be THP-mapped, just those executables and ranges where alignment and size permit. Future optimizations may include fine-tuning these checks to try to better determine whether an application would actually benefit from THP mapping. From some quick and dirty experiments I performed, I've seen that there are a surprising number of applications that may end up with THP-mapped pages, including Perl, Chrome and Firefox. However I don't yet know what the actual vs. theoretical benefits would be. -- Bill