Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp843618imu; Wed, 16 Jan 2019 08:28:15 -0800 (PST) X-Google-Smtp-Source: ALg8bN6Gw4m3OUaJ3JOlRJJliJX7ueZR6SjK84aLEmvKvQQrgvyWGXGdDrVOYi8iJ5WkO4wnGPt5 X-Received: by 2002:a65:584e:: with SMTP id s14mr9650592pgr.142.1547656095221; Wed, 16 Jan 2019 08:28:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547656095; cv=none; d=google.com; s=arc-20160816; b=XKWAPpZV9bhGUjod9Jr7ELqVwatCVqvwK6wySj+y/8klSMXWl4HKlRUsIp7DguRas4 py2jP/RXNyLodhucDxFJVTknEW0pjGVgBhd1ofuZETMmlXe5ZHs+URS5NejOa+BBGPtZ qc/Z7qyZaZRGd1HTR31YWmX3gZc0xDizimHTkc9ecE0Gu00VqEfs50l4hoNVbPrBpjdF dBQ8SCYWo0XjLM5+EvLXm93ybS6Gtcl8sJSfSrwllAAI1UdDHz+Nt5vUwzTBDsHjSE9K qmgqCXGEIo485G7MgKE99lRl+NMrWb9nx73vVfVDyWdx3iQGke9Ki2HhXGSgj/h8lecJ CYDg== 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=MyahoR9gA3cZPmJ4fRmUUg2fkKftA4/cTtIIntxPKm0=; b=mcqIB8go2v0eciXKH5vENKs5cdlK1WNT5fAVzldXHrjXwDQhvVeFfC/ly7la4XcuzZ gACbb+VqFjj5ZEoOEiyKAAqDZvIbFcTqhAH4xE7/JZV3okXzoe3m2YChfHyNDRmy1rEI mHhhwSu8ORxLzHFM8s2rm3fzVvNLB120sK+G9rHXnzaiPnGC/S659qbS8jHYwNeOYZT6 56vmMNiDiyHGlGy0vTgBemN/2Q/y5k3ryP1tBTEWybOV/F13SWA8Wc2Ni/8bg00g+4Zk WiMBpb0wb1l4b3SVw4WkjO9r7hPl9tiKvydEvryuaMx3XyeIRYQTuuc/fHCBvZNvnBNc uOpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=AoIGPgeI; 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 c191si6974774pfg.72.2019.01.16.08.27.56; Wed, 16 Jan 2019 08:28:15 -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=AoIGPgeI; 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 S1725902AbfAPFAt (ORCPT + 99 others); Wed, 16 Jan 2019 00:00:49 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:41718 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725887AbfAPFAs (ORCPT ); Wed, 16 Jan 2019 00:00:48 -0500 Received: by mail-lf1-f66.google.com with SMTP id c16so3844451lfj.8 for ; Tue, 15 Jan 2019 21:00:47 -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=MyahoR9gA3cZPmJ4fRmUUg2fkKftA4/cTtIIntxPKm0=; b=AoIGPgeIUOnsX1DPPQIz4mINWsh4eAVO7IZuYdn9y4NELoNnTOraTGcibFzGsdnWQu kZll5DLe2ClnMoYrsv4IXeCv2kriiDIwHXaVU6mcbZKXlqLHoeZXdJtz+8Islp9hHoGC sy7X+9W6kpegaZwAxwmWrxB6j8+30F1v7C9/U= 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=MyahoR9gA3cZPmJ4fRmUUg2fkKftA4/cTtIIntxPKm0=; b=cHdyrkfJZhTCeTF67YSamdkKEIHiVrCi3yg+FTe36r9UGyoWKWR09PxldkgxrInM+k kufjOycHBkVvetptm2+A27YWBAt94bhmhuJfR5mufhTlSK2MzyVcQi457XOXxIHdjuox GpHmpo0Qd9OAuBrWqdXs1jUvJ+WuyprUTRxNNNQsYh/dwL9vsbVOfWfpLBhA/5Vwf6gm gH/POWcOIixADAEzPED7CwaVVOSQM0ekpT7VT6htFB15l+KJZFsPdx3FqzcmcGGtD4v1 7xDn8hSb+8jactWsSATljCHdFmPYMYu16ZQRCWn1dQRyb+cpcFhbbtSadIPDAWFf0lGV I5tA== X-Gm-Message-State: AJcUuke2Td63srfabFGw5A+me3kbuMYepejIMTWoiFzWM5i1MYcuvM/y cWWDOLRNtNA9tmZHjukhrx3a6q3jPxM= X-Received: by 2002:a19:2584:: with SMTP id l126mr5149040lfl.69.1547614846067; Tue, 15 Jan 2019 21:00:46 -0800 (PST) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com. [209.85.167.52]) by smtp.gmail.com with ESMTPSA id b81-v6sm871546ljb.7.2019.01.15.21.00.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Jan 2019 21:00:43 -0800 (PST) Received: by mail-lf1-f52.google.com with SMTP id e26so3862061lfc.2 for ; Tue, 15 Jan 2019 21:00:42 -0800 (PST) X-Received: by 2002:a19:c014:: with SMTP id q20mr5034140lff.16.1547614842100; Tue, 15 Jan 2019 21:00:42 -0800 (PST) MIME-Version: 1.0 References: <20190108044336.GB27534@dastard> <20190109022430.GE27534@dastard> <20190109043906.GF27534@dastard> <20190110004424.GH27534@dastard> <20190110070355.GJ27534@dastard> <20190110122442.GA21216@nautica> <5c3e7de6.1c69fb81.4aebb.3fec@mx.google.com> In-Reply-To: <5c3e7de6.1c69fb81.4aebb.3fec@mx.google.com> From: Linus Torvalds Date: Wed, 16 Jan 2019 17:00:25 +1200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] mm/mincore: allow for making sys_mincore() privileged To: Josh Snyder Cc: Dominique Martinet , Dave Chinner , 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 12:42 PM Josh Snyder wrote: > > For Netflix, losing accurate information from the mincore syscall would > lengthen database cluster maintenance operations from days to months. We > rely on cross-process mincore to migrate the contents of a page cache from > machine to machine, and across reboots. Ok, this is the kind of feedback we need, and means I guess we can't just use the mapping existence for mincore. The two other ways that we considered were: (a) owner of the file gets to know cache information for that file. (b) having the fd opened *writably* gets you cache residency information. Sadly, taking a look at happycache, you open the file read-only, so (b) doesn't work. Judging just from the source code, I can't tell how the user ownership works. Any input on that? And if you're not the owner of the file, do you have another suggestion for that "Yes, I have the right to see what's in-core for this file". Because the problem is literally that if it's some random read-only system file, the kernel shouldn't leak access patterns to it.. Linus