From patchwork Tue Dec 11 14:36:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 10723911 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7483A91E for ; Tue, 11 Dec 2018 14:36:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 626FF29B27 for ; Tue, 11 Dec 2018 14:36:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5481A2A04F; Tue, 11 Dec 2018 14:36:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDC8729B27 for ; Tue, 11 Dec 2018 14:36:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8CB6A8E0099; Tue, 11 Dec 2018 09:36:51 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 87B628E0095; Tue, 11 Dec 2018 09:36:51 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 744158E0099; Tue, 11 Dec 2018 09:36:51 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by kanga.kvack.org (Postfix) with ESMTP id 168DD8E0095 for ; Tue, 11 Dec 2018 09:36:51 -0500 (EST) Received: by mail-ed1-f70.google.com with SMTP id v4so6861640edm.18 for ; Tue, 11 Dec 2018 06:36:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:mime-version:content-transfer-encoding; bh=6JYjh+0yMAl1qSgfk1x6M2ZZ4rNUmedP28jYCrv49TY=; b=Q/LTUBrf5VxVbXNt5KtT23NkGLk53gttPGb/X73gDmOpla7av1+fwNIjXw03OfSLnu JCFourE/+LA3dcagxVBzQdddvQA3xInlWPnDButIHzi91ZbN43IhEC5ZjFeNSLvxWW5S //sMK7NSLjDP9eyj4N3lFqte8bT9jIvQCK+vAOofyLXy+ppaf2DIGqHZabeUeVQ15PFl NS5MOPxLjg24KQOwzBp4njcgSMDwl4nPLS3EwdsFLz2Kd4P7Z66Jpm9v7YTEpJ0zWbM/ kx7C3fTIiEwiJ6BEzoaNyhOxrDgVRa41wW17Gl0nAk572n9skuV0hYsF7Ut1u0mFc+ur ompA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of mstsxfx@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=mstsxfx@gmail.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Gm-Message-State: AA+aEWamTHHnrQ4TgSlUXe7qEt9BS7Rd3sQ9ifskoSwZ7uPjF5vtFT/T 8M3yjNoXeB9Weasit+O9rzn9LLjCm9prQ/Q9Ml/hKVv6B/RXWWnvnKJsXUAVvxpju3MjY8V575w HaYCvW0kAbKIJ0xYFReurjwWup/IjYvOpzBJbdm31j9fJDHHt3s/8BFQDBanD7AzDXlT35KNIzN myQEPsQ0ydnz/b1SIbzlI44PvnYyX0PW5yv/WOh3LjzsoCagw/y9inw+pJHCQDKgF1PFXJpcwAX p7WPbZUq8fUN55ogL5hrxc8C7IncTzznny5v+W7sJjU6YdKochas/7nXUG4NqRQq/Y6vaZ2UDq8 tO0EQQVIHG0vh3A2+Bz73s4E73k/ceOKcIhBLEWM/N4mnCZqLqam64vMsARCdgjHFpR3qKYsFQ= = X-Received: by 2002:a50:951a:: with SMTP id u26mr15378674eda.4.1544539010513; Tue, 11 Dec 2018 06:36:50 -0800 (PST) X-Received: by 2002:a50:951a:: with SMTP id u26mr15378616eda.4.1544539009445; Tue, 11 Dec 2018 06:36:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544539009; cv=none; d=google.com; s=arc-20160816; b=kqrUqyVgJlFlCUKJn2X5mbFdbij+aj8oQT9rsQ8K7Bje63PSLEA4jO/zGAIQ9bcbM4 c90kOrhtBSnCr27FaaGud0aAL7ZDrTCc6Nj2T4HMSuAuuwshF2Y/6Gl0LjT6wT0nqWtP y6NqVZff+zViCpqqR8F5xt1AciimIqpsQJS172aR+L63t34W4VaoahuIKURpbXNTdaNe 1H02MGukEDV4jSGWYW7QizC1fCo4xOgnu4hdJttyUGvH41ke1wEKETQSEbcEGmoc/6cz 0qRxH2VUpOp70VxwJyccS2HEfq5ZHC99T5wvaW5uvRxCLfLJM3cB/MUR746qe08XOC10 e2HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=6JYjh+0yMAl1qSgfk1x6M2ZZ4rNUmedP28jYCrv49TY=; b=t7vw77oBewqKE51tq0yY6Ue5D51C0oC0vaR7aMB9vbxTXU++d5qHFjeLSm6rIjhpfL B2o8WZEUYt+bPqPP7UrjxZWx/cfKuqsPSv1FZ7t4hoRViYLCvy5+4i4pkWwxn4c2Husq BCvZxxqydH0VBN5HNVNfUWEAo8MMd+9BXMo5T1ZwOPC7VQyzD4a1JYQhAePb09urcPWh E+28Pl4mYrMtzuqwTxARXqBWQgTs1Q+rVgf0ROxKp7s6hFY4W+Z5yd12gKKxl+BVlbfs YyYat08G+2NnTJ9XS3ck/ko+FSpbPj9Bq9TvFcNLVBb6RVNGP4loEqJcNPsi2/6m51oB pFIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of mstsxfx@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=mstsxfx@gmail.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id p2-v6sor3750551ejr.31.2018.12.11.06.36.49 for (Google Transport Security); Tue, 11 Dec 2018 06:36:49 -0800 (PST) Received-SPF: pass (google.com: domain of mstsxfx@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; spf=pass (google.com: domain of mstsxfx@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=mstsxfx@gmail.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Google-Smtp-Source: AFSGD/X+7qKEXHj6z9FFzkR9Hizd6ozwcuRjk5QvfAAQKQU95feCYZVDLocsAXP1NBA+uGiCvL8S7w== X-Received: by 2002:a17:906:f6cb:: with SMTP id jo11-v6mr12637748ejb.80.1544539009053; Tue, 11 Dec 2018 06:36:49 -0800 (PST) Received: from tiehlicka.suse.cz (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id z40sm4017084edz.86.2018.12.11.06.36.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 06:36:48 -0800 (PST) From: Michal Hocko To: Andrew Morton Cc: linux-api@vger.kernel.org, , LKML , Dan Williams , David Rientjes , Jan Kara , Michal Hocko , Mike Rapoport , Vlastimil Babka Subject: [PATCH 0/3] THP eligibility reporting via proc Date: Tue, 11 Dec 2018 15:36:38 +0100 Message-Id: <20181211143641.3503-1-mhocko@kernel.org> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 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: X-Virus-Scanned: ClamAV using ClamSMTP Hi, I've posted this as an RFC [1] and there didn't seem to be any pushback so I am posting it for inclusion. If there are any concerns, please speak up. Original cover: This series of three patches aims at making THP eligibility reporting much more robust and long term sustainable. The trigger for the change is a regression report [2] and the long follow up discussion. In short the specific application didn't have good API to query whether a particular mapping can be backed by THP so it has used VMA flags to workaround that. These flags represent a deep internal state of VMAs and as such they should be used by userspace with a great deal of caution. A similar has happened for [3] when users complained that VM_MIXEDMAP is no longer set on DAX mappings. Again a lack of a proper API led to an abuse. The first patch in the series tries to emphasise that that the semantic of flags might change and any application consuming those should be really careful. The remaining two patches provide a more suitable interface to address [2] and provide a consistent API to query the THP status both for each VMA and process wide as well. [1] http://lkml.kernel.org/r/20181120103515.25280-1-mhocko@kernel.org [2] http://lkml.kernel.org/r/http://lkml.kernel.org/r/alpine.DEB.2.21.1809241054050.224429@chino.kir.corp.google.com [3] http://lkml.kernel.org/r/20181002100531.GC4135@quack2.suse.cz