Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5753610ybi; Wed, 31 Jul 2019 02:48:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqx4GnVBndNSUK11OOw5jgyPUWBTup/IprEk9IPhOmD2UN9P2FTQqRzm3lgUrhgYCmx4KaYq X-Received: by 2002:a17:902:2aab:: with SMTP id j40mr67053911plb.76.1564566538694; Wed, 31 Jul 2019 02:48:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564566538; cv=none; d=google.com; s=arc-20160816; b=t9dyvmjlV6QuGBhZpBo/+dODUdeqnztFeXJA4u1SwMip1AR8Tq52GVDTyoWChLv/yy w5/DK5FDFc+Hhs3xIkuhm0OgnTTwJCnSt3yPGE2dNVwLZzxIuvxzTP2veUXgrkSWh6m1 X8F3VomribRKeu9f1UpWYFTSEk8o6GP6jhl9wWEWEA8o0NrszVTtOJA4PFL0vvShzkTZ Oflaj/pl9aShKa1IjDT/bwfw6/ie7GOjAkrJNuDaeHaOy/m4dkHnG2z+2TGRJhRie54G PJ9Xf1sBB3xWmVNSF2IS8eou31H9ZS/E05oIdt9kb0jTX16LMrj2mHC87p2X56Emi9Ta QPVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=GsMyYZltyVkiUgPix6eZw4DKTyNFfETnvHB4Ds8HiVc=; b=YENeXodqgS9d31hGOLipe62ERMb66Hx3FyQBgS4EbYJAEIIJlNlW9E0yjtdXOgkeyN xd9nVJkH8sjvlyHBJ9SjgZwOMSlmFh3Blm87sb/lh4+C+NIb/v2KMtOKzDz3Zdugx5wy cT8K8TJ466rGfBjttmKA/ous2xnBQa3eDXHBjk2OHYJo/0YDmNJWmXtL1lQNTv67lt0m GYQ4hc94zuzVB8uYBAfGQoFINVpg/etktgv4KnTu0+8ExtRDxG7hFhPM+fbGgStmjMvC RlsuX/i4cx5D7QK8uAXUBMi15D9jCJe1cI27BdUHDjA9/Zuj7WFUubV+xyn73SOF8mRZ BChQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gz4EhWDw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b41si29892172pla.409.2019.07.31.02.48.43; Wed, 31 Jul 2019 02:48:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gz4EhWDw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727508AbfGaI6Y (ORCPT + 99 others); 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-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