Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp333033imu; Fri, 11 Jan 2019 00:58:39 -0800 (PST) X-Google-Smtp-Source: ALg8bN7J23o1qGzRX1fvNPIcW9oxdtZ/Tu+JbiZ5xQ6aVtay3l2UR4flg+g4qDcXVkcECCiza07s X-Received: by 2002:a17:902:20c8:: with SMTP id v8mr13948161plg.319.1547197119629; Fri, 11 Jan 2019 00:58:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547197119; cv=none; d=google.com; s=arc-20160816; b=K1s8qsowYmSiFWQDgfD3rNJwzFlvhmFakyvU+WjdW8ZjCR6u/MPTdZPzbtyk+fxMk7 2ANrdWSZukz6lMV/Us3DJNjQmexR2XaNo0CNtkozFCnrxoQnUDTNDjEq/7bY3qkDstTO ZJABQlaTPhwfGDcwdeK5RQGjSS01hiRzdi5lnPrufFh1vWpzGT2J+UReo6NF8ZBAbWWb xu0EIF+6qYzoAJSu69NLDhxX5C4mu+QMpAkO0Xtsei7I049XYxiVr7tWzoX2fhr9wBUL magUxDBgofZGFOFzavOM9/qAQvCIgzbohzWekXLwNFS+5cM3OqcAYdV+2rbsqzFzYusV Olzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=9DmuEyWQdhQ8h+STvyYlmxnVCbYukClceUj4CxSpnlU=; b=fOrMcecjn4ydJQtij/KVW4aAeW5fhPkaiDXLA5og1Ji67BT/BL9CB4TnJd8UhIeOsy l1XueuNKttN75B7x9NrAVktnHLZKmMJ17eUIY/oCZL9G28vo/CHs7qVjTVyUYLsZGj71 b9xoc84DFeA5TuyzKrMhwJB/g4isREFhDpJCSLcCkNjH6Fg9V5td0w3dJJBLVjgB0Oe0 evHhfpP9PkweIF84Hz9kppmwj7zhUEzxNlZ179jSch51yeCrN+WN5cvFhJwFOS7uO3au s5ctkKKhWfyfm/2yX4zpqLhLCVdT+aIqp8nfxpCHN3Yrv3X455+LVc1tCMlxkVln/ZE/ 7bhA== ARC-Authentication-Results: i=1; mx.google.com; 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 w31si22447086pla.308.2019.01.11.00.58.24; Fri, 11 Jan 2019 00:58:39 -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; 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 S1728882AbfAKHcZ (ORCPT + 99 others); Fri, 11 Jan 2019 02:32:25 -0500 Received: from nautica.notk.org ([91.121.71.147]:56667 "EHLO nautica.notk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727578AbfAKHcY (ORCPT ); Fri, 11 Jan 2019 02:32:24 -0500 Received: by nautica.notk.org (Postfix, from userid 1001) id CA660C01B; Fri, 11 Jan 2019 08:32:21 +0100 (CET) Date: Fri, 11 Jan 2019 08:32:06 +0100 From: Dominique Martinet To: Linus Torvalds Cc: Dave Chinner , Jiri Kosina , Matthew Wilcox , Jann Horn , Andrew Morton , Greg KH , Peter Zijlstra , Michal Hocko , Linux-MM , kernel list , Linux API Subject: Re: [PATCH] mm/mincore: allow for making sys_mincore() privileged Message-ID: <20190111073206.GA1303@nautica> References: <20190109043906.GF27534@dastard> <20190110004424.GH27534@dastard> <20190110070355.GJ27534@dastard> <20190110122442.GA21216@nautica> <20190111045750.GA27333@nautica> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Linus Torvalds wrote on Thu, Jan 10, 2019: > But those numbers aren't about the mincore() change. That's just from > dropping caches. > > Now, what's the difference with the mincore change, and without? Is it > actually measurable? > > Because that's all that matters: is the mincore change something you > can even notice? Is it a big regression? > > The fact that things are slower when they are cold in the cache isn't > the issue. The issue is whether the change to mincore semantics makes > any difference to real loads. mincore itself isn't used to reload the data, but is necessary to know *what* you need to reload. If you don't know what pages are hot, how can you preload them? For small enough a database and with enough memory you can act stupid and load the whole tables in cache, that's what I did because I was lazy and only had a big mysql data set around. But the container warming up automaton Dave mentioned and postgresql db preloading with pgfincore explicitely depend on being able to tell what they need to preload. pgfincore documentation states: ---- set of PostgreSQL functions to manage blocks in memory Those functions let you know which and how many disk block from a relation are in the page cache of the operating system, and eventually write the result to a file. Then using this file, it is possible to restore the page cache state for each block of the relation. ---- If you cannot dump an arbitrary "hot state" x, you cannot restore it. This is all basically a repeat of the other subthread; sure precaching itself doesn't need mincore and if you're all-knowing the syscall isn't needed, but mere mortals need it. If it's about the commit itself, vmtouch tells me 0 page in these database files are in cache when I reboot to a 5.0-rc1 kernel and run some queries, so the difference after a fresh boot is exactly what I stated. I'm probably missing something but I'm not quite sure in what situation the "new mincore" has any use right now. -- Dominique Martinet | Asmadeus