From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AIpwx4+ncHoJM0AzQ//h7GHrcxRoBze+mCSKXS+qWU3odIZZ/lGNnd2k0BMn/HCtPBtFk9atXs3z ARC-Seal: i=1; a=rsa-sha256; t=1524405784; cv=none; d=google.com; s=arc-20160816; b=K7K5Ffx1Dr1XaYTYUxC6DK+SbvI1b/qfWnlNh5rX6wpxLx6vfLpVpgTUQwy5q1EgfH h2rZXO/neS5WLeFVfkvSVuUI2eWaJVdWs0wpLJv1nRLrQVLMF8z6we2FuCC98t1lpr+J pOuUcSgZTQpRZdtFIVpdZuzEWL27Jei20DEAPiHpknZZfy+HRFE6ePfO1VJBENKznq6J V4TAHI9gxkqnvW1vxSHSJOr0hwTFrgSWbITodwAk/mb2vim90IEa/WvUwzGZZc08lm4F IOnKFrOFFTDLvrcjcYvE2vMiYCDDHXEhoCMRpmq8wVz5odjPHcCSZQ1V4p+enniy/EoK vhDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=BbmUwbMPL8FgzVXMCxPdxFifymIM8NqDENjp4mtI5Gw=; b=Cx/Zhqt1OKbnZzAYBwN9XDgFZH1zSjlPtoYFBudf6xLzVvY6XGzU+1daIDheCFUoDd jxX1qPxgR6f2gwJuYGD0mQwlI3spUOmF7tgCy8GSjVVkDyuIp7Cyv1XzjzOlFh27N5lk oYQx/238tChlt29yZ/LfPf84h7Zi3es0F3nwR5YUD9LMDm4MHZLDSzP+Y/rf42XzcZ1I Rlcv++Tl+dWleSwSpmcNCBgRNROPVfoz31VkEeKnbGziI5241gFf1s127wjSrGv02Dt3 jB1eZXnOfmM9490JqQrJ0V4p2aYA9Irro1yyOMphwQnQNyvgeUUjDvpACC1MoCxNBinS iQTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=q6cT4QPo; spf=pass (google.com: best guess record for domain of willy@infradead.org designates 198.137.202.133 as permitted sender) smtp.mailfrom=willy@infradead.org Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=q6cT4QPo; spf=pass (google.com: best guess record for domain of willy@infradead.org designates 198.137.202.133 as permitted sender) smtp.mailfrom=willy@infradead.org Date: Sun, 22 Apr 2018 07:02:46 -0700 From: Matthew Wilcox To: David Hildenbrand Cc: Vlastimil Babka , linux-mm@kvack.org, Steven Rostedt , Ingo Molnar , Andrew Morton , Michal Hocko , Huang Ying , Greg Kroah-Hartman , Pavel Tatashin , Miles Chen , Mel Gorman , Rik van Riel , James Hogan , "Levin, Alexander (Sasha Levin)" , open list Subject: Re: [PATCH RFC 2/8] mm: introduce PG_offline Message-ID: <20180422140246.GA30714@bombadil.infradead.org> References: <20180413131632.1413-1-david@redhat.com> <20180413131632.1413-3-david@redhat.com> <20180413171120.GA1245@bombadil.infradead.org> <89329958-2ff8-9447-408e-fd478b914ec4@suse.cz> <20180422030130.GG14610@bombadil.infradead.org> <7db70df4-c714-574c-5b14-898c1cf49af6@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7db70df4-c714-574c-5b14-898c1cf49af6@redhat.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1597637040722220932?= X-GMAIL-MSGID: =?utf-8?q?1598455319484645360?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: On Sun, Apr 22, 2018 at 10:17:31AM +0200, David Hildenbrand wrote: > On 22.04.2018 05:01, Matthew Wilcox wrote: > > On Sat, Apr 21, 2018 at 06:52:18PM +0200, Vlastimil Babka wrote: > >> Sounds like your newly introduced "page types" could be useful here? I > >> don't suppose those offline pages would be using mapcount which is > >> aliased there? > > > > Oh, that's a good point! Yes, this is a perfect use for page_type. > > We have something like twenty bits available there. > > > > Now you've got me thinking that we can move PG_hwpoison and PG_reserved > > to be page_type flags too. That'll take us from 23 to 21 bits (on 32-bit, > > with PG_UNCACHED) > > Some things to clarify here. I modified the current RFC to also allow > PG_offline on allocated (ballooned) pages (e.g. virtio-balloon). > > kdump based dump tools can then easily identify which pages are not to > be dumped (either because the content is invalid or not accessible). > > I previously stated that ballooned pages would be marked as PG_reserved, > which is not true (at least not for virtio-balloon). However this allows > me to detect if all pages in a section are offline by looking at > (PG_reserved && PG_offline). So I can actually tell if a page is marked > as offline and allocated or really offline. > > > 1. The location (not the number!) of PG_hwpoison is basically ABI and > cannot be changed. Moving it around will most probably break dump tools. > (see kernel/crash_core.c) It's not ABI. It already changed after 4.9 when PG_waiters was introduced by commit 62906027091f. > 2. Exposing PG_offline via kdump will make it ABI as well. And we don't > want any complicated validity checks ("is the bit valid or not?"), > because that would imply having to make these bits ABI as well. So > having PG_offline just like PG_hwpoison part of page_flags is the right > thing to do. (see patch nr 4) > > 3. For determining if all pages of a section are offline (see patch nr > 5), I will have to be able to check 1. PG_offline and 2. PG_reserved on > any page. Will this be possible by moving e.g. PG_reserved to page > types? (especially if some field is suddenly aliased?) It's possible to tell whether the field is in use as mapcount or page_types; mapcount should always be non-negative, and page_types reserves a few bits to detect under/overflow of mapcount. The slab/slob users of the field will also be positive uses.