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 9FA3EC433FF for ; Wed, 31 Jul 2019 08:58:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 575AA20693 for ; Wed, 31 Jul 2019 08:58:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gz4EhWDw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 575AA20693 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 01B198E0005; Wed, 31 Jul 2019 04:58:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F0E888E0001; Wed, 31 Jul 2019 04:58:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DD5938E0005; Wed, 31 Jul 2019 04:58:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from mail-io1-f70.google.com (mail-io1-f70.google.com [209.85.166.70]) by kanga.kvack.org (Postfix) with ESMTP id BFD408E0001 for ; Wed, 31 Jul 2019 04:58:24 -0400 (EDT) Received: by mail-io1-f70.google.com with SMTP id n8so74470053ioo.21 for ; Wed, 31 Jul 2019 01:58:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:subject:to:cc:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=GsMyYZltyVkiUgPix6eZw4DKTyNFfETnvHB4Ds8HiVc=; b=b1bizQhJMvPg1KOEb8NNHzclRqf2gvTiJfMOK/cbfW0btdF7parfV7K0JxvIj9Mzna Dmu5FLHMieL68eN9woy6oQCLoCc2jIodCbEZGtbEnT4gQ43PoHtO+bX9vZfb7qzGKNu2 dlrh6HtQ61fRIYK2uEqf9gLTd6GdQfUuSsi0kBCyHNM6iEcIqETVdyiAgBtDvKIvMjnr kiD43jp1ErHbuBH19TfL7KRALKuD/HvWccYy15FHAUyKElICjIOpt/rGQ5ocIDUMu27S Ev+AO7+ey/n0YC/3a95n5AxDY0D7QbklXTHputLLUKJDrPHSAOWMa7iNeypoFgZ3IIkC 3acg== X-Gm-Message-State: APjAAAXrlTNWOx9K0cEKX86999Dz7ZvTRVk9HGR/kwhX/lrZhiVhKUz9 PmmCTT9MEibX9EHsE2XgQ7z8d45/Vr4/MAQB+vnioN32+Gzn4T65b0r6VfdBH9ERNcAZBoTiCas tCmZexdKqZ/FX1avo5iYUmDfZlJQ9LVmQDvkKnolES14J527HYkpfMsfumn2/za4Wag== X-Received: by 2002:a6b:7401:: with SMTP id s1mr4472341iog.67.1564563504526; Wed, 31 Jul 2019 01:58:24 -0700 (PDT) X-Received: by 2002:a6b:7401:: with SMTP id s1mr4472305iog.67.1564563503927; Wed, 31 Jul 2019 01:58:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564563503; cv=none; d=google.com; s=arc-20160816; b=wck99TC3cxgl91gimJEOvHma61O2zfkuFb0F3GLk8FB6DCb71shDHIyXjprnJkdEHI jVYNc808PD1st0vKIQ+g9xvhx+QWgQYdMmJ3iRZrq3kQAKRjSN+0hnFwbB47D1JUhamS p/dQeWTyEY86grBZlRxJcPFcu5S4+zyWp2eXoe51+kHsiZGARW2J4/hZEGbMP6F9wX0B xYl7VkIM3s8VHg2KG8cJRfYqsq44jvZVY+y7cV8AxsYHgumMvZCnL5vgYQL+aR4QBLsq BthAq+c7DSr7YtLRQZUOjyvv12tcwsGbFHB4ZBh+jjB+DLpTw7sDkybd2TGFPuWR0D/P 6M8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=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=lhPKxuXILBerxuKrxaT9AZbfKo7mhBHe3ak17A4u//un/rQ3fR3h6CJe3aX8OGJaGf AFvM560U04sk//MfXWNIZQcRPSX3vyfiKwDUtiNBVNVu+P9ekX6MtbGCX4/Aslwz+NrP jMQGE9uMIueyDnB7TxenzryxMM3jg2GDXjzHE7CHanI7qrRhViQlIHq/HZNf3RfPIO+2 W4srgXrCOUudsx6ifXNXNBIeEAaSDt/9g+shlS9gT3HseA5IB5kTMagS/pO3ePIaU7sT d9fQL7kh56Iu3g96PgXlyjw/slh1Kj3/TApQR4AAaZfipZyhd6RxaUveF8Hz0dm25zoM ozyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gz4EhWDw; spf=pass (google.com: domain of kucharsk@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=kucharsk@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id a10sor16959198ioo.124.2019.07.31.01.58.23 for (Google Transport Security); Wed, 31 Jul 2019 01:58:23 -0700 (PDT) Received-SPF: pass (google.com: domain of kucharsk@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gz4EhWDw; spf=pass (google.com: domain of kucharsk@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=kucharsk@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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-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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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