From patchwork Tue Nov 20 10:35:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 10690203 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 97FE614BD for ; Tue, 20 Nov 2018 10:35:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8BB4A2906E for ; Tue, 20 Nov 2018 10:35:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 800362A87C; Tue, 20 Nov 2018 10:35:33 +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 1548E2906E for ; Tue, 20 Nov 2018 10:35:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0BED46B1FCB; Tue, 20 Nov 2018 05:35:32 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 06F8C6B1FCC; Tue, 20 Nov 2018 05:35:32 -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 E7AB46B1FCD; Tue, 20 Nov 2018 05:35:31 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by kanga.kvack.org (Postfix) with ESMTP id 8DE1D6B1FCB for ; Tue, 20 Nov 2018 05:35:31 -0500 (EST) Received: by mail-ed1-f71.google.com with SMTP id s50so1046343edd.11 for ; Tue, 20 Nov 2018 02:35:31 -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=cZ6VZMIljRfGjZ5SmAgXfmbGgE7sRwEooFqEb0nTS0I=; b=ohOm7CvXVs88/wSrAbKib/9QMNeskqgXSzqhZJ/uliJb7CNrGtGUQsSxjsj+VvmSV/ UW9AgL4WHwy0Y3g8uYI3vIwBd5yRim+iXiG6CdgW74l9ofs3/wSF6hD8WZ6u0qci0XEG mqtUfZQfC7DTH3uilPVZgcbqaPtu687WF6VVfoxtlDvHWRK7yXyaB+j6i9F6orRBsDbc T9N+bJJXxRF4DG7dw6EeaT38eYepjZi37H259LzK+SaBzuIvfB/Buwizp/NJ+0GnP1UO SXypyMlmDhcoo/Ji2Bqw2QGkNJvtYLDoJns5pq5AZvbfvfvpIRJ8SAenaxtjsm9jUXqi L6Fw== 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+aEWaGsV8HlHT55ipxD8zUwQQ7WQYFSe/zhHcfTbwJ6NDwQKYJvCr4 MFADfxqomj3CCw0bZLR7LXPf7m6hPZRDcAbwRGyNDITYMi0RqDNWc+QlbiU5O/Pua5HavKZty65 eKIq/K0CNVL82ib7tPCqVq7liK/v+ldmRbiVvj5tIrDENeHUbUZBpgTMLwYRDP7QHWkS7lE8rS4 /1xez85eF/WmBEpJHPX1G0iJNFptk2NMH8tGqKsEwmlPIXO0thy9P6KENKOcrqnvqf8LKM9h0M8 N9cVfnxb0S6RgnDAvBcH0DxzGBdnsK3zJ++Dlq9u9/7pOdjzxXiNVTvhGgdMMimhFg/d+32Of1B 8vw1i7yI8zGLZS0b2L+QdQGg6KcKfwPoPIm7v83QBCL5U48OY/gzrve3MtQniW8m64joqCT/DQ= = X-Received: by 2002:aa7:d8d3:: with SMTP id k19mr1804867eds.64.1542710131072; Tue, 20 Nov 2018 02:35:31 -0800 (PST) X-Received: by 2002:aa7:d8d3:: with SMTP id k19mr1804830eds.64.1542710130179; Tue, 20 Nov 2018 02:35:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542710130; cv=none; d=google.com; s=arc-20160816; b=oNaBa9N7YX6ClOC+y0Uhi9t3E/NrivgOmit31FjrV128pWp7NO2I6qdzg0y4Wr6qR/ t4ZctIjpuDx/a8D/Lo5tj5r2GWBjanDeBkx6YsCBzOOqMonE6kiIUY+pqi3iTpDnKpxU Awttgn7smQoCrw4KysyI50hqMbeWbfFXjsAk85bT5FS/x+JYAdN3CNOhpZ/diHSY/XcZ VbMuK8G0ueeZZ8WwCRYgNbFNq9l/UVe2L48pQyqHHm8REcCXm+26iy1wTcqxriS9NBvB 9gcv5p+dYGEM/8VTxROgl7mrYegWBmegPBV9l7LT/jbZOdpDnuuVVXjweusgEUcuS/ZU fERw== 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=cZ6VZMIljRfGjZ5SmAgXfmbGgE7sRwEooFqEb0nTS0I=; b=sR8fpSt6tHrz0ApzaQ24FkPNd1dV03PIWPxcXCnVfpgZhA6IJiPWP77yWzHGjjGVHQ yarcQgOOy6cscxiZEizwfLmAOGnjaGu3Ak5ciE0n0QQpanrcEMxOBs2K3LGm5wy/gFF6 XyAOObkIn9waITbYS1aVt15BdU/fo8VoHrgJQJT81VsELMdbcI9Nj/ULHpASbCJiP5te 253RZsoWOkpsK4Jz6X3IibpAIvVAHWU0lJ7lq7x2649i3icXmdXw2BujJ1Cmaj0TRwEd 8HmcTY2YaDcdpVdU9B4b4N/2IdnKDxdW0TGN3PW21QpafOA5XpqrBFYsq/znfh/Y+sAl 1bwg== 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 b9sor2895833eda.20.2018.11.20.02.35.29 for (Google Transport Security); Tue, 20 Nov 2018 02:35:30 -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/XWfFLT5IQ8zuKu614Nyn0CNrwYEyBt2W5cBjtUGfvdTtrzmfqh/8Fb0kGp9tl5nIQLugWrNQ== X-Received: by 2002:a50:a7c1:: with SMTP id i59-v6mr1797998edc.37.1542710129568; Tue, 20 Nov 2018 02:35:29 -0800 (PST) Received: from tiehlicka.suse.cz (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id a15-v6sm5967233ejj.5.2018.11.20.02.35.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Nov 2018 02:35:28 -0800 (PST) From: Michal Hocko To: linux-api@vger.kernel.org Cc: Andrew Morton , Alexey Dobriyan , , LKML , Dan Williams , David Rientjes , Jan Kara , Michal Hocko Subject: [RFC PATCH 0/3] THP eligibility reporting via proc Date: Tue, 20 Nov 2018 11:35:12 +0100 Message-Id: <20181120103515.25280-1-mhocko@kernel.org> X-Mailer: git-send-email 2.19.1 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, 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 [1] 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 [2] 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 [1] 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/http://lkml.kernel.org/r/alpine.DEB.2.21.1809241054050.224429@chino.kir.corp.google.com [2] http://lkml.kernel.org/r/20181002100531.GC4135@quack2.suse.cz