Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2197444imu; Sat, 5 Jan 2019 17:52:46 -0800 (PST) X-Google-Smtp-Source: ALg8bN5mhYEzh8q3q43qGrw52MRxMBwqbuYUsAFXWwQBGpHnvtgDkRueuqir/+0xciltjGDj3d2f X-Received: by 2002:a63:ea15:: with SMTP id c21mr50916785pgi.361.1546739566164; Sat, 05 Jan 2019 17:52:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546739566; cv=none; d=google.com; s=arc-20160816; b=07jMsEL0K+Utq4Jl5Ycn1ZyeZH4F6UPFDu5wcflt78zlQA81YDO+ZpeVq4dSU1pbSY B2lycwTXLIXpyBIn2o1JjEW0V7zbCLG2ryD/aZY/3GL7szN/Q7jKHNA3X+Ysucfpmon+ Uu7/+2kwKJcEBtsSZxwhaQZXLrHt23LgzMpWiU+KAI8NJVE2j5G+USf9Gmhc+Hba6o9i pv50lyCRCuqk/TZirLvWQBXkkvjD15LPFdrYmMDqdBA0jX92Sy0OVVpuvP/6F8ePINcO qUD03n9266xfIMq4pQg6PbHXC0Ynfp4Zv3MNPXQeqWp+f8kAuz/aDiKdcdUF9csqHHx2 3/qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=AcswdOBczXk+iMEaWZLv2123bIfAtssmPcZQKRLxpec=; b=urPjdDlAkpxBrXJFePnS4fXOc2/nDi9iceE7iKD0Zj1f+aNsXnyJMUtk7N2CFMe92x ndWnWLUjjBHoSP2DefNnhIdq5O+mtBJYiJgkxss/TMLUA+2cq6vEWp2qBVPjfxDCJI8D TBmvd2F6+9in5XAJejGPZ6Y3Bwmp5utJ3/fAJciJlfD21UZDkFv/Gfq2NTq+BZ1O9oM3 8fQOvsl3dJ95ew8zDHWn+2y1ar48dGxThfBsVszl1+nszAz1fyQ9TMMw2jSRO4x9gsjg LUJXl/rIl1cDEY2kte6zxq26ne4yCIjDUtIhm2kLWqJO/b6uyIYK0vaKTKYveI5qUd+J 7ftQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Um4YEyAt; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e129si2803944pgc.333.2019.01.05.17.52.30; Sat, 05 Jan 2019 17:52:46 -0800 (PST) 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=@linux-foundation.org header.s=google header.b=Um4YEyAt; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726395AbfAFBvX (ORCPT + 99 others); Sat, 5 Jan 2019 20:51:23 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:41321 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726377AbfAFBvW (ORCPT ); Sat, 5 Jan 2019 20:51:22 -0500 Received: by mail-lf1-f66.google.com with SMTP id c16so27835300lfj.8 for ; Sat, 05 Jan 2019 17:51:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AcswdOBczXk+iMEaWZLv2123bIfAtssmPcZQKRLxpec=; b=Um4YEyAt8jYVvSh/qfFiqPF+GCGUMUEdHNIOKX3UpSSg+Jiiq+gkn8CZUF4jdBJxd5 ZcIyf17YCpILnvKPAgOoflI/KyDQRA5TVSSZoMnoaUCNfSp9CUyGyNuqDxtLhGzrhKXo B7zTL8Hn+Ok5KsEFJHpktWBjGUYOLesmk/W0o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AcswdOBczXk+iMEaWZLv2123bIfAtssmPcZQKRLxpec=; b=nSrO/JVME32GYDhbr1rkUodQ2el8eu/vDPQnEts6BzyCeLrX5QiVqUHc3pquA/gPHC dYlFgzyGfY7SeC0SNqtKdzII7kJLxzlM1/rKU1GRfV8nJRvG1shaen9+joOKRJE6+gko WyJkcg+Ej9eEBlLdBk3HiArfCdyJb9nQn7Jojqfgvm82IC445wT112i1MAuJ0UHfozb7 oedO/F4dBqvdH0Dq4EGDGBd7IIzpntQ9WJCvnrqqAIa+Ujc/40U5vN6dn8Ls26sb26CD nj9wEuKSFHuznVag4/92i7Sy2j03bzBXbuBsBPw53NCaoRTyOWdBJHuUxlo5BaaBu6Gb yr3A== X-Gm-Message-State: AA+aEWYGiSvSFykULRalJA1QZg7U9slXUiLSgfgl5QzYF+UX9BFRoEaQ gq/YPnOXLT9xeYwlo8La9EF9qRr4ih4= X-Received: by 2002:a19:f204:: with SMTP id q4mr30174927lfh.133.1546739479368; Sat, 05 Jan 2019 17:51:19 -0800 (PST) Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com. [209.85.167.49]) by smtp.gmail.com with ESMTPSA id z6sm12043232lfd.50.2019.01.05.17.51.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Jan 2019 17:51:16 -0800 (PST) Received: by mail-lf1-f49.google.com with SMTP id i26so27882305lfc.0 for ; Sat, 05 Jan 2019 17:51:16 -0800 (PST) X-Received: by 2002:a19:6e0b:: with SMTP id j11mr30297686lfc.124.1546739475480; Sat, 05 Jan 2019 17:51:15 -0800 (PST) MIME-Version: 1.0 References: <20190106001138.GW6310@bombadil.infradead.org> In-Reply-To: From: Linus Torvalds Date: Sat, 5 Jan 2019 17:50:59 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] mm/mincore: allow for making sys_mincore() privileged To: Matthew Wilcox Cc: Jann Horn , Jiri Kosina , Andrew Morton , Greg KH , Peter Zijlstra , Michal Hocko , Linux-MM , kernel list , Linux API Content-Type: multipart/mixed; boundary="000000000000ff4c37057ec05817" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --000000000000ff4c37057ec05817 Content-Type: text/plain; charset="UTF-8" On Sat, Jan 5, 2019 at 4:22 PM Linus Torvalds wrote: > > But I think my patch to just rip out all that page lookup, and just > base it on the page table state has the fundamental advantage that it > gets rid of code. Maybe I should jst commit it, and see if anything > breaks? We do have options in case things break, and then we'd at > least know who cares (and perhaps a lot more information of _why_ they > care). Slightly updated patch in case somebody wants to try things out. Also, any comments about the pmd_trans_unstable() case? Linus --000000000000ff4c37057ec05817 Content-Type: text/x-patch; charset="US-ASCII"; name="patch.diff" Content-Disposition: attachment; filename="patch.diff" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_jqk8qbng0 IG1tL21pbmNvcmUuYyB8IDk0ICsrKysrKysrKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogMSBmaWxlIGNoYW5nZWQsIDEzIGluc2VydGlvbnMoKyks IDgxIGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL21tL21pbmNvcmUuYyBiL21tL21pbmNvcmUu YwppbmRleCAyMTgwOTliNWVkMzEuLmYwZjkxNDYxYTlmNCAxMDA2NDQKLS0tIGEvbW0vbWluY29y ZS5jCisrKyBiL21tL21pbmNvcmUuYwpAQCAtNDIsNzIgKzQyLDE0IEBAIHN0YXRpYyBpbnQgbWlu Y29yZV9odWdldGxiKHB0ZV90ICpwdGUsIHVuc2lnbmV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