Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1870944ybe; Thu, 12 Sep 2019 00:28:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhzKdTxyb6aBX9/SClOgq+sTTd6SpgGt0q6tHjKtuALHl9C63Gd1rqPKPKpdgJXw4vp0A3 X-Received: by 2002:a50:886d:: with SMTP id c42mr38023873edc.24.1568273292189; Thu, 12 Sep 2019 00:28:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568273292; cv=none; d=google.com; s=arc-20160816; b=lwnHMny0wvpoYaqfCfadGV9+/fQH/EbgQxHLWdZBU58SfR+cO9+Gq7fl0fgrMZx/KT oZc4zuDuEIQ9/rOuOZO2XAk+KSPYgSuHVOCBRpmuMPfRf3kVcV2MNRU5LGViFhRinqgf fN+bqZ52pySDp9/zzuRJ8M0+brNQCKGXhcA8DCWl+laUTGeNx3ynefqiXWGGuM/mXrCI zFDqpXEVLTnWjb44Ir1tdRXKEb+78nUmLo+LTxcorJBPCudz4qR6CmVU+EhmMVFF2ZsT CXfeP23COhZvEQQjWx17pzmHBIYXnMJyFHUDAFU87JEcO/aWw9h8wG+9Ar2BW70e1IfZ nsqQ== 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=ir0C8iCFvkcd44RaKS4VnZAIMl5wlcEbTgo1qkmhwMw=; b=ZzkcTItYo9OtBPniN7gEegQaqeZv3zNMEtRbPMnXSy5601EFSW59CCC17ufpwNlC1Q BY7XcXabNK6EvPTp1idEMltc9DumGme+GNtI7zLVMS8a826twlfUkNo9HgVwQuw6UVei pFjaMIkoe2KcLZ3fcBvBMJj5URkWj+0qxwbDcOnQTP6a+oV0DXJZ/kNqjscFkp8plmno wci4xh7ywNIQd/RhnnFSo3km2ljR+yD05sYZhsgsFSFMZDyJoqFrGVn4PNJ3CCnRLaQF P8qwvWEa8Ku+8Hf2RfnJ5h+RqVrjLq4RhgIA1NWp1f9yc0Ffe06XXuKiKkxEXaeAn1JK 1JEg== 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 rl2si4270431ejb.230.2019.09.12.00.27.48; Thu, 12 Sep 2019 00:28:12 -0700 (PDT) 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 S1729785AbfILHQh (ORCPT + 99 others); Thu, 12 Sep 2019 03:16:37 -0400 Received: from mx2.suse.de ([195.135.220.15]:40482 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728927AbfILHQh (ORCPT ); Thu, 12 Sep 2019 03:16:37 -0400 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 DA634AE35; Thu, 12 Sep 2019 07:16:34 +0000 (UTC) Date: Thu, 12 Sep 2019 09:16:33 +0200 From: Michal Hocko To: David Hildenbrand Cc: "Michael S. Tsirkin" , Alexander Duyck , Alexander Duyck , virtio-dev@lists.oasis-open.org, kvm list , Catalin Marinas , Dave Hansen , LKML , Matthew Wilcox , linux-mm , Andrew Morton , will@kernel.org, linux-arm-kernel@lists.infradead.org, Oscar Salvador , Yang Zhang , Pankaj Gupta , Konrad Rzeszutek Wilk , Nitesh Narayan Lal , Rik van Riel , lcapitulino@redhat.com, "Wang, Wei W" , Andrea Arcangeli , ying.huang@intel.com, Paolo Bonzini , Dan Williams , Fengguang Wu , "Kirill A. Shutemov" Subject: Re: [PATCH v9 0/8] stg mail -e --version=v9 \ Message-ID: <20190912071633.GL4023@dhcp22.suse.cz> References: <20190911113619.GP4023@dhcp22.suse.cz> <20190911080804-mutt-send-email-mst@kernel.org> <20190911121941.GU4023@dhcp22.suse.cz> <20190911122526.GV4023@dhcp22.suse.cz> <4748a572-57b3-31da-0dde-30138e550c3a@redhat.com> <20190911125413.GY4023@dhcp22.suse.cz> <736594d6-b9ae-ddb9-2b96-85648728ef33@redhat.com> <20190911132002.GA4023@dhcp22.suse.cz> <20190911135100.GC4023@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 On Wed 11-09-19 18:09:18, David Hildenbrand wrote: > On 11.09.19 15:51, Michal Hocko wrote: > > On Wed 11-09-19 15:20:02, Michal Hocko wrote: > > [...] > >>> 4. Continuously report, not the "one time report everything" approach. > >> > >> So you mean the allocator reporting this rather than an external code to > >> poll right? I do not know, how much this is nice to have than must have? > > > > Another idea that I haven't really thought through so it might turned > > out to be completely bogus but let's try anyway. Your "report everything" > > just made me look and realize that free_pages_prepare already performs > > stuff that actually does something similar yet unrelated. > > > > We do report to special page poisoning, zeroying or > > CONFIG_DEBUG_PAGEALLOC to unmap the address from the kernel address > > space. This sounds like something fitting your model no? > > > > AFAIKS, the poisoning/unmapping is done whenever a page is freed. I > don't quite see yet how that would help to remember if a page was > already reported. Do you still have to differ that state when each page is reported? > After reporting the page we would have to switch some > state (Nitesh: bitmap bit, Alexander: page flag) to identify that. Yes, you can either store the state somewhere. > Of course, we could map the page and treat that as "the state" when we > reported it, but I am not sure that's such a good idea :) > > As always, I might be very wrong ... I still do not fully understand the usecase so I might be equally wrong. My thinking is along these lines. Why should you scan free pages when you can effectively capture each freed page? If you go one step further then post_alloc_hook would be the counterpart to know that your page has been allocated. -- Michal Hocko SUSE Labs