Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7955547imu; Thu, 15 Nov 2018 04:22:37 -0800 (PST) X-Google-Smtp-Source: AJdET5fuKYV6/SJpGpA5OnbvtitfxgJprVPGmJHT4Q+lseVONA5x0WaDPZreNQxMwhfyVdESJCvH X-Received: by 2002:a17:902:8608:: with SMTP id f8-v6mr5927964plo.95.1542284557403; Thu, 15 Nov 2018 04:22:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542284557; cv=none; d=google.com; s=arc-20160816; b=0phtetH0ZlAzkRajx7EjK922icpT9neQJXP1Yn/EfkH55lmV5CwyY26XKfMZggj16P hHV2TEkENu07gRU9fBG5XLmDB5q2YlNTYKYYkqdBPCnEPFqOkSPQtNfswWcrSJsZGNFy o8Uere69wud1/bQc5Rc0yMXNKeejKm5oefypgF+BYilMdTmlyHpL6sOBbfRCK3LRCRIJ FjhImA+orG6igbPQ291nsQXSVTsSqwYtcV/hO6XGjYqFsTuRywiX8R55cGs2tnzNVLwT 4eJot2DjPvzy92HN1V3BF65fcpEDCB3gfnyZv0C1CShLKiXbfkcxtDL33fWJ9R+g7xQ0 OfaQ== 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=1Fz6bURnKEwJS+nhGf/sU9o2Otphj9rp900aUElTI14=; b=SsUTe6o532rL3iEK/l/Rowm5BrbQ1kuDFuQ4P4QsZvGXOXPiF8t9n/WGcGdG2DC2dt 2rr6LnD9oXkxw+sjQIR+XwfJv2PgO3ILPHYASLrINcj/XsNlRrCPWfwVO0vzBnfCpBBV PmVooKwSwCkQmiy94JEgg6t+qDdrkqNsvFg0O9VXXVmlJfq9MG14g0H0mRF/u+c8pPPD sGMQZAPhbr/BzhNce8HPlykWtT41kFIqZijF/oHCFjii0sWoFtHlA13UFQb6R44Ba2v4 k+onxHmqPrptl15DlrgoRSHs+9D5qptyQYYZ1PYyUZQf9/FzAQc+ifwBlJ9qbRbTQHgW 0KRw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e189si7690843pfc.202.2018.11.15.04.22.22; Thu, 15 Nov 2018 04:22:37 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388345AbeKOW1i (ORCPT + 99 others); Thu, 15 Nov 2018 17:27:38 -0500 Received: from mx2.suse.de ([195.135.220.15]:52632 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729008AbeKOW1i (ORCPT ); Thu, 15 Nov 2018 17:27:38 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D3A3AB023; Thu, 15 Nov 2018 12:19:57 +0000 (UTC) Date: Thu, 15 Nov 2018 13:19:50 +0100 From: Michal Hocko To: David Hildenbrand Cc: Mike Rapoport , Matthew Wilcox , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, devel@linuxdriverproject.org, linux-fsdevel@vger.kernel.org, linux-pm@vger.kernel.org, xen-devel@lists.xenproject.org, Jonathan Corbet , Alexey Dobriyan , Mike Rapoport , Andrew Morton , Christian Hansen , Vlastimil Babka , "Kirill A. Shutemov" , Stephen Rothwell , "Michael S. Tsirkin" , Pavel Tatashin , Alexander Duyck , Naoya Horiguchi , Miles Chen , David Rientjes , Konstantin Khlebnikov Subject: Re: [PATCH RFC 2/6] mm: convert PG_balloon to PG_offline Message-ID: <20181115121950.GQ23831@dhcp22.suse.cz> References: <20181114211704.6381-1-david@redhat.com> <20181114211704.6381-3-david@redhat.com> <20181114222321.GB1784@bombadil.infradead.org> <20181115020725.GC2353@rapoport-lnx> <5730ee16-9b18-ad3d-0fb3-e9edb55e2298@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5730ee16-9b18-ad3d-0fb3-e9edb55e2298@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [Cc Konstantin - the patch is http://lkml.kernel.org/r/20181114211704.6381-3-david@redhat.com] On Thu 15-11-18 10:21:13, David Hildenbrand wrote: > On 15.11.18 03:07, Mike Rapoport wrote: > > On Wed, Nov 14, 2018 at 11:49:15PM +0100, David Hildenbrand wrote: > >> On 14.11.18 23:23, Matthew Wilcox wrote: > >>> On Wed, Nov 14, 2018 at 10:17:00PM +0100, David Hildenbrand wrote: > >>>> Rename PG_balloon to PG_offline. This is an indicator that the page is > >>>> logically offline, the content stale and that it should not be touched > >>>> (e.g. a hypervisor would have to allocate backing storage in order for the > >>>> guest to dump an unused page). We can then e.g. exclude such pages from > >>>> dumps. > >>>> > >>>> In following patches, we will make use of this bit also in other balloon > >>>> drivers. While at it, document PGTABLE. > >>> > >>> Thank you for documenting PGTABLE. I didn't realise I also had this > >>> document to update when I added PGTABLE. > >> > >> Thank you for looking into this :) > >> > >>> > >>>> +++ b/Documentation/admin-guide/mm/pagemap.rst > >>>> @@ -78,6 +78,8 @@ number of times a page is mapped. > >>>> 23. BALLOON > >>>> 24. ZERO_PAGE > >>>> 25. IDLE > >>>> + 26. PGTABLE > >>>> + 27. OFFLINE > >>> > >>> So the offline *user* bit is new ... even though the *kernel* bit > >>> just renames the balloon bit. I'm not sure how I feel about this. > >>> I'm going to think about it some more. Could you share your decision > >>> process with us? > >> > >> BALLOON was/is documented as > >> > >> "23 - BALLOON > >> balloon compaction page > >> " > >> > >> and only includes all virtio-ballon pages after the non-lru migration > >> feature has been implemented for ballooned pages. Since then, this flag > >> does basically no longer stands for what it actually was supposed to do. > > > > Perhaps I missing something, but how the user should interpret "23" when he > > reads /proc/kpageflags? > > Looking at the history in more detail: > > commit 09316c09dde33aae14f34489d9e3d243ec0d5938 > Author: Konstantin Khlebnikov > Date: Thu Oct 9 15:29:32 2014 -0700 > > mm/balloon_compaction: add vmstat counters and kpageflags bit > > Always mark pages with PageBalloon even if balloon compaction is > disabled > and expose this mark in /proc/kpageflags as KPF_BALLOON. > > > So KPF_BALLOON was exposed when virtio-balloon pages were always marked > with PG_balloon. So the documentation is actually wrong ("balloon page" > vs. "balloon compaction page"). > > I have no idea who actually used that information. I suspect this was > just some debugging aid. > > > > >> To not break uapi I decided to not rename it but instead to add a new flag. > > > > I've got a feeling that uapi was anyway changed for the BALLON flag > > meaning. > > Yes. If we *replace* KPF_BALLOON by KPF_OFFLINE > > a) Some applications might no longer compile (I guess that's ok) > b) Some old applications will treat KPF_OFFLINE like KPF_BALLOON (which > should at least for virtio-balloon usage until now be fine - it is just > more generic) I do not think any compilation could break. If the semantic of the flag is preserved then everything should work as expected. -- Michal Hocko SUSE Labs