Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1375893imu; Wed, 16 Jan 2019 18:29:44 -0800 (PST) X-Google-Smtp-Source: ALg8bN5gfG/LdPN2vz9x2glRC7RE2RvxDXaoalBtaHPlJCtuFQquZsKY/YIHtt2v5LGMThhadgYl X-Received: by 2002:a17:902:8d94:: with SMTP id v20mr12982840plo.194.1547692184938; Wed, 16 Jan 2019 18:29:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547692184; cv=none; d=google.com; s=arc-20160816; b=nWTArdaRhpAmZkVbLlFPDRZ72AnuRVBF3TFHvJlT7HzNNQROt+ZlBpvxlsJNI8WOfM msB11hLA87v/BPwWa4pIOgvDNri+Mwbh+V0kxjc7dvzuy85QIfmSVu4O9Y1SVAEo+6m9 fcM/5s/zLuws0MoIrXZWCsCmi8Fd+ljfAHTr5qvbBXms3ynnr46jPzmsgsxGkiglbjD4 0+bcZcBiSQ+6qxfjx3E9dmgPgvnCBtakBMUidpSXNOvhapOXWPdGKHhu/WU7+Mpb0pi9 /uOWxqvI/4tFwvk/A5Lm5rw64qKuG/ral92NChIBiJPJooHr7NdTo5fWP86i72zc6oud iTAw== 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=VZ1+S4udBrUGqA2qKTo5GfQAEHGyi6IpM7GyhEi/87Q=; b=vIOATxLaFOwEek5qhkR27X3eBPVWkMyR05oqNqJAlsI7aNSl3QWopA5kmRb86p/RlH 81mgyZv+EA9sM78lEbbXsIHYvovhxLk1CBvT24hZirePc+8/SIetlZaYfZIT+Rw31MjV HRCOdZnujA0zNnmauOiVbuR1Lv2k51rDFxEIr55MIk/aAtKC5+/rZBlwJ4OI7/iNZlKm Cz7RTxhf8nTgvPj7V0OlDlk6RftmTvEgw+oabEntXcEYkxgyI9748WpJfLqwLlIXO5Qh 7A8J5Bnn/vcLlY34wTYnsNJlXRhuFGG6hBbaL+E/Tb7+NmEm6PVryrq7MvAhF5hDZy/7 4M/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Cm8s3Ol6; 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 q140si330525pfc.20.2019.01.16.18.29.26; Wed, 16 Jan 2019 18:29:44 -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=Cm8s3Ol6; 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 S1732829AbfAPFuI (ORCPT + 99 others); Wed, 16 Jan 2019 00:50:08 -0500 Received: from mail-lf1-f65.google.com ([209.85.167.65]:37368 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728494AbfAPFuH (ORCPT ); Wed, 16 Jan 2019 00:50:07 -0500 Received: by mail-lf1-f65.google.com with SMTP id y11so3924953lfj.4 for ; Tue, 15 Jan 2019 21:50:06 -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=VZ1+S4udBrUGqA2qKTo5GfQAEHGyi6IpM7GyhEi/87Q=; b=Cm8s3Ol69OXV+2VWR7fkXnsX1n+j4dzdhPWdlz+bQiLV2defpBkGRVFg2h3wehxX/B m22hjZI3XvFBpyA+dLrVT89Aow6fflPmxfHCQP4AbP8oZLi4pChb1R0mNyMz920VsOlR MEg/wP8hNUn4G/821olrUDpO5emm1o1mNr/E4= 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=VZ1+S4udBrUGqA2qKTo5GfQAEHGyi6IpM7GyhEi/87Q=; b=AxL96kmHPfIBbqB4EPPNTwWkp+WSmFVnFn4teC1xmkHnhErc3pXo+LDlTlRkXkj2VE xmiHY78wMvA6BxdTBa0g886CaGNviSxDMSO+u19bXIH+4GqUqMGBxPHbN1CjAOpJ01gJ uh9kM6fXeodJo6rFUqoWc2p19l0L4re9FroqLHyGk2GAWC0Co3J+kKmBF+1oNOM/XnWu loqv/y7Ej5KrIlYg822nffpHnakzcc+z3R/bNge9j6SztizH03RVqw3pS/bdwLJntV8S 7JZdyhWhr2L2TqedcBqZlqABBKZLhah15GSxj1BAyCSfZG/ErTMfPaIoAHY+1M7H1OsC qeBg== X-Gm-Message-State: AJcUukf0mXkL8KM9JuaK0hOzb7dvm315FnQwIgFvA4m+G5qvoBP7tHkP 8Zhsaa+wuIideQUFrkwDk2pnW+6BgQA= X-Received: by 2002:a19:f89:: with SMTP id 9mr5351322lfp.10.1547617805290; Tue, 15 Jan 2019 21:50:05 -0800 (PST) Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com. [209.85.167.51]) by smtp.gmail.com with ESMTPSA id g24sm982860lfh.33.2019.01.15.21.50.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Jan 2019 21:50:04 -0800 (PST) Received: by mail-lf1-f51.google.com with SMTP id e26so3927636lfc.2 for ; Tue, 15 Jan 2019 21:50:03 -0800 (PST) X-Received: by 2002:a19:7006:: with SMTP id h6mr5627124lfc.147.1547617803433; Tue, 15 Jan 2019 21:50:03 -0800 (PST) MIME-Version: 1.0 References: <20190110070355.GJ27534@dastard> <20190110122442.GA21216@nautica> <20190111020340.GM27534@dastard> <20190111040434.GN27534@dastard> <20190111073606.GP27534@dastard> <20190115234510.GA6173@dastard> In-Reply-To: From: Linus Torvalds Date: Wed, 16 Jan 2019 17:49:46 +1200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] mm/mincore: allow for making sys_mincore() privileged To: Dave Chinner Cc: Dominique Martinet , Jiri Kosina , Matthew Wilcox , Jann Horn , Andrew Morton , Greg KH , Peter Zijlstra , Michal Hocko , Linux-MM , kernel list , Linux API Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 16, 2019 at 4:54 PM Linus Torvalds wrote: > > On Wed, Jan 16, 2019 at 11:45 AM Dave Chinner wrote: > > > > I'm assuming that you can invalidate the page cache reliably by a > > means that does not repeated require probing to detect invalidation > > has occurred. I've mentioned one method in this discussion > > already... > > Yes. And it was made clear to you that it was a bug in xfs dio and > what the right thing to do was. Side note: I actually think we *do* the right thing. Even for xfs. I couldn't find the alleged place that invalidates the page cache on dio reads. The *generic* dio code only does it for writes (which is correct and fine). And maybe xfs has some extra invalidation, but I don't see it. So I actually hope your "you can use direct-io read to do directed invalidating of the page cache" isn't true. I admittedly did *not* try to delve very deeply into it, but the invalidates I found looked correct. The generic code does it for writes, and at least ext4 does the "writeback and wait" for reads. There *does* seem to be a 'invalidate_inode_pages2_range()' call in iomap_dio_rw(). That has a *comment* that says it only is for writes, but it looks to me like it would trigger for reads too. Just a plain bug/oversight? Or me misreading things. So yes, maybe xfs does that "invalidate on read", but it really seems to be just a bug. If the xfs people insist on keeping the bug, fine (looks like gfs2 and xfs are the only users), but it seems kind of sad. Linus