Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp158222ybl; Mon, 12 Aug 2019 13:39:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqwgCtGtMki4vflxpMjlkidqNkFUSROVHvi9mS1hjshE2aRMphjHCH+sU7bRcPBF6nmddMJa X-Received: by 2002:a63:4c0d:: with SMTP id z13mr31548236pga.28.1565642354457; Mon, 12 Aug 2019 13:39:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565642354; cv=none; d=google.com; s=arc-20160816; b=T9rzj6jpDRGTD+EAh9I0a7KMwxfFJXYXORuYhvPSinxuMDMNBdGH3bawHB+DXkWe2A w1F+AtmKzxanxFtbU2lAkTxo0ePypVA0QQweDCpD38I5ujQ3KwCLj5sOf2rRX0YDx/ud NZ5KioMyPhlNM0Z2dyCTs8N58/Tg3q+IMa9zxD8BUTq6r3tRJ1b5wBjdFymKipMaDJtZ 1IDWh5jS+MsEblXahjEIl4C64SuWtL207Mvxb72ysAEkwhWjNXg/Y2XvKXIT3M34VHDV Xti/ySBdv143lZL5PoKClMIpnD5aLFuMd4OwKF5GR9h1ZE4o7PEswXjE77krZAnPNOEV TFwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=JmUZr7y0Vz2xdCv3h+uqvQ8rGr3KsFz2eHJHYMvJh/8=; b=zFRNuGPvn6kDVs4v4Lz87/AhR+iokB6tDR6N/nzj6q9VKdZ+LHRMe/TXpXziDJiadY a0VX1qmOTHsF5Q+vqd/Z2bQr34Uhu6/uJdiGtbQvI3OnghYmV7TVM83lpIZuqoI3NBYF 3pcT2I4vnzrQZv6ORnYuY90KXQ5ULVBp+RYajA5dFsJkKHSjlxGHjoqX0R/XARhIl5kI sjgOJSDZ++oBnapqNfSy2di+Z+KRMT+16DMdLHaok1xp4fkzBQHEfrZpbI6oowZ7aC5t UGjTIupwRf1fmH6FdfWvZELzOtJbDpS5joqW5ZQQoQRgmX4s5BnZbK1oTnGzeyvnva6j Hf7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=rG0dFUj7; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 200si10627865pfy.246.2019.08.12.13.38.58; Mon, 12 Aug 2019 13:39:14 -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=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=rG0dFUj7; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726710AbfHLUgS (ORCPT + 99 others); Mon, 12 Aug 2019 16:36:18 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:41361 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726527AbfHLUgR (ORCPT ); Mon, 12 Aug 2019 16:36:17 -0400 Received: by mail-pg1-f194.google.com with SMTP id x15so39720788pgg.8 for ; Mon, 12 Aug 2019 13:36:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=JmUZr7y0Vz2xdCv3h+uqvQ8rGr3KsFz2eHJHYMvJh/8=; b=rG0dFUj7rqFxLYUcS0Cl/+bBlfn0vxQ4HWngVOp21pFxw6lq/KzhhDSznW3J87rEMa dFAQl10nuUQwmCt9l6ekbkPPd2bFCzydLmUORfOuDM0+UaVEdaod420qe0IgaHsUqCCv ahUb/2XWujO52+WJhX0vBthKQUIYrR48hR12iJzIKEU/d6qXHx/wQZeHYg6+emIT6InX VL5suQAGwauW8UJRK5pcroiM1jD0zbTAmtme2prRjcEqMLvwELSZw0Cx5R2FxRDVpTLc rAkprfGc1K3fX92MGMI8mhRm9ViL/qJHidlqfIIPGjw1SJrKaZfDWvS+tVLevc9Iybxz lpYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=JmUZr7y0Vz2xdCv3h+uqvQ8rGr3KsFz2eHJHYMvJh/8=; b=E0/rJlofO49sGk6FhTWTwAHfjrd4MLaXRf7f9m279sefXnk0kHGNJe7PL1sA/U5V+h ixPg/+guw6YY1O0Hm0RDBO6PV58yPRIb+KNjHqFGTiveJrV8PlJ4dTQpzDGRoqaDLzP5 TVuPmP2MhF+QZUE0Puz30VDgnCulDaNEwDVVZx9UGGWqMYbT5X4pD6M/9vHFz1GlGfKQ 5bM8xAFxJAOfj09Wg/n3zeOtQe407TbM9Tf3mYyilfQkHFxiW5PpATvG9z2eVPUjALTr lWI+nlZKK2SJPUV0hr7tzKxo703JclB9PKsB9GgJOuOK/t+UwMXYVIPYFuN2D1/fk7C4 lJwg== X-Gm-Message-State: APjAAAUPftIu5vEVwgNBeNj6OWTIDuih1uSf/3rEz3LCWQF2Es1I+4/K 0htnFOyD9keEn97xxTSMlhIfoQ== X-Received: by 2002:aa7:9882:: with SMTP id r2mr5141299pfl.146.1565642176946; Mon, 12 Aug 2019 13:36:16 -0700 (PDT) Received: from localhost ([2620:10d:c091:500::2:f08]) by smtp.gmail.com with ESMTPSA id m145sm9023428pfd.68.2019.08.12.13.36.15 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 12 Aug 2019 13:36:16 -0700 (PDT) Date: Mon, 12 Aug 2019 16:36:14 -0400 From: Johannes Weiner To: Song Liu Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, matthew.wilcox@oracle.com, kirill.shutemov@linux.intel.com, kernel-team@fb.com, william.kucharski@oracle.com, akpm@linux-foundation.org, hdanton@sina.com Subject: Re: [PATCH v10 6/7] mm,thp: add read-only THP support for (non-shmem) FS Message-ID: <20190812203614.GB15498@cmpxchg.org> References: <20190801184244.3169074-1-songliubraving@fb.com> <20190801184244.3169074-7-songliubraving@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190801184244.3169074-7-songliubraving@fb.com> User-Agent: Mutt/1.12.0 (2019-05-25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 01, 2019 at 11:42:43AM -0700, Song Liu wrote: > This patch is (hopefully) the first step to enable THP for non-shmem > filesystems. > > This patch enables an application to put part of its text sections to THP > via madvise, for example: > > madvise((void *)0x600000, 0x200000, MADV_HUGEPAGE); > > We tried to reuse the logic for THP on tmpfs. > > Currently, write is not supported for non-shmem THP. khugepaged will only > process vma with VM_DENYWRITE. sys_mmap() ignores VM_DENYWRITE requests > (see ksys_mmap_pgoff). The only way to create vma with VM_DENYWRITE is > execve(). This requirement limits non-shmem THP to text sections. > > The next patch will handle writes, which would only happen when the all > the vmas with VM_DENYWRITE are unmapped. > > An EXPERIMENTAL config, READ_ONLY_THP_FOR_FS, is added to gate this > feature. > > Cc: Johannes Weiner > Acked-by: Rik van Riel > Acked-by: Kirill A. Shutemov > Signed-off-by: Song Liu Acked-by: Johannes Weiner