Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1157370ybp; Wed, 9 Oct 2019 09:36:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqxbGcACtpsNsZmbV0VktXAY9nUyEReWVrXu32EWDZqRNdD0d28fMs1E2Sr5jjULiUs12YgA X-Received: by 2002:a17:906:c2c1:: with SMTP id ch1mr3534044ejb.321.1570638977265; Wed, 09 Oct 2019 09:36:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570638977; cv=none; d=google.com; s=arc-20160816; b=sHyqxsqpMTmXl3jYPGPRJfRY9hA9/MJhlbEgcBSAbS6EgYNq5ggeuJ9Q/fXGtfZsJ5 Tymr5bn6nDtBnXJ981DbWLQVAqf/5WEg4LdPIJ8sQ6P60Bwc1MiUZoSfFFblBgzyffaW TxijbQ+8NLkHOfrsB2xdQGyP0t08IeMFSH8Fe7jDCvx7NQiMeuRsDXeeL4hAToIJAzPU Fv0tf5JxyesICdq0s9mYH8RVq064Q3yD5nCuLwrGB5/GmYmlW59JXhXBjUe/TUNa6zwN C9W0xAc4KQk2xGCVpVBCjifx2hHfIO0iUGcC7zEQeyQgZRpFRen/GIxvWPyMqCikh4Q5 5vdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=PoMGRkKmP1Eacw85TRypYRhpshI2cAzpwhEPjVg7qjk=; b=kW7oIn8o5gbXiAKihpc7BrJlfZpcw7QAAzCRNhEHVo/6sogdfbgYyFGmRlHYepp6y0 6lD5StyJo5u3SsKCcoirWhHQTjJW5IxO27Gz6+JpxyV2gRVLcJ8GgrS3qQW2yzZd1PT/ CdlRoDdqSwNGeN57SgTZYgUmiAlnyN6qJleqFxD6pHL0rwYgU+eiLGUNU1zuzRt1X2IN 6qukONFnPnvtmNvEhK3DVcxeY308wa51E08hhGrVhaZjte/VZUjkCXE9s/2Z4T1a4ObX Qzo4+87zWZ/bcOWBTc6+8KldH2ufhUR1J6qvwk2jG1oYGMogKo/yj6e/7kq0yIDtItn2 Y+/A== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ot22si1491362ejb.153.2019.10.09.09.35.53; Wed, 09 Oct 2019 09:36:17 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731731AbfJIQfT (ORCPT + 99 others); Wed, 9 Oct 2019 12:35:19 -0400 Received: from mga14.intel.com ([192.55.52.115]:46952 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730490AbfJIQfT (ORCPT ); Wed, 9 Oct 2019 12:35:19 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Oct 2019 09:35:18 -0700 X-IronPort-AV: E=Sophos;i="5.67,276,1566889200"; d="scan'208";a="187670690" Received: from ahduyck-desk1.jf.intel.com ([10.7.198.76]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Oct 2019 09:35:17 -0700 Message-ID: <22ce946f7a5cf0b7b4c8058c400d8b9b4c63a5a5.camel@linux.intel.com> Subject: Re: [PATCH v11 0/6] mm / virtio: Provide support for unused page reporting From: Alexander Duyck To: Nitesh Narayan Lal , Dave Hansen , Michal Hocko , Mel Gorman , Andrew Morton , Vlastimil Babka Cc: LKML , linux-mm , Alexander Duyck , David Hildenbrand , kvm list , "Michael S. Tsirkin" , Matthew Wilcox , Oscar Salvador , Yang Zhang , Pankaj Gupta , Konrad Rzeszutek Wilk , Rik van Riel , lcapitulino@redhat.com, "Wang, Wei W" , Andrea Arcangeli , Paolo Bonzini , Dan Williams Date: Wed, 09 Oct 2019 09:35:17 -0700 In-Reply-To: <5c640ecb-cfef-2fa6-57aa-1352f1036f4e@redhat.com> References: <20191001152441.27008.99285.stgit@localhost.localdomain> <7233498c-2f64-d661-4981-707b59c78fd5@redhat.com> <1ea1a4e11617291062db81f65745b9c95fd0bb30.camel@linux.intel.com> <8bd303a6-6e50-b2dc-19ab-4c3f176c4b02@redhat.com> <0a16b11e-ec3b-7196-5b7f-e7395876cf28@redhat.com> <7fc13837-546c-9c4a-1456-753df199e171@redhat.com> <5b6e0b6df46c03bfac906313071ac0362d43c432.camel@linux.intel.com> <5c640ecb-cfef-2fa6-57aa-1352f1036f4e@redhat.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2019-10-09 at 11:21 -0400, Nitesh Narayan Lal wrote: > On 10/7/19 1:06 PM, Nitesh Narayan Lal wrote: > [...] > > > So what was the size of your guest? One thing that just occurred to me is > > > that you might be running a much smaller guest than I was. > > I am running a 30 GB guest. > > > > > > > If so I would have expected a much higher difference versus > > > > > baseline as zeroing/faulting the pages in the host gets expensive fairly > > > > > quick. What is the host kernel you are running your test on? I'm just > > > > > wondering if there is some additional overhead currently limiting your > > > > > setup. My host kernel was just the same kernel I was running in the guest, > > > > > just built without the patches applied. > > > > Right now I have a different host-kernel. I can install the same kernel to the > > > > host as well and see if that changes anything. > > > The host kernel will have a fairly significant impact as I recall. For > > > example running a stock CentOS kernel lowered the performance compared to > > > running a linux-next kernel. As a result the numbers looked better since > > > the overall baseline was lower to begin with as the host OS was > > > introducing additional overhead. > > I see in that case I will try by installing the same guest kernel > > to the host as well. > > As per your suggestion, I tried replacing the host kernel with an > upstream kernel without my patches i.e., my host has a kernel built on top > of the upstream kernel's master branch which has Sept 23rd commit and the guest > has the same kernel for the no-hinting case and same kernel + my patches > for the page reporting case. > > With the changes reported earlier on top of v12, I am not seeing any further > degradation (other than what I have previously reported). > > To be sure that THP is actively used, I did an experiment where I changed the > MEMSIZE in the page_fault. On doing so THP usage checked via /proc/meminfo also > increased as I expected. > > In any case, if you find something else please let me know and I will look into it > again. > > > I am still looking into your suggestion about cache line bouncing and will reply > to it, if I have more questions. > > > [...] I really feel like this discussion has gone off course. The idea here is to review this patch set[1] and provide working alternatives if there are issues with the current approach. The bitmap based approach still has a number of outstanding issues including sparse memory and hotplug which have yet to be addressed. We can gloss over that, but there is a good chance that resolving those would have potential performance implications. With this most recent change there is now also the fact that it can only really support reporting at one page order so the solution is now much more prone to issues with memory fragmentation than it was before. I would consider the fact that my solution works with multiple page orders while the bitmap approach requires MAX_ORDER - 1 seems like another obvious win for my solution. Until we can get back to the point where we are comparing apples to apples I would prefer not to benchmark the bitmap solution as without the extra order limitation it was over 20% worse then my solution performance wise. Ideally I would like to get code review for patches 3 and 4, and spend my time addressing issues reported there. The main things I need input on is if the solution of allowing the list iterators to be reset is good enough to address the compaction issues that were pointed out several releases ago or if I have to look for another solution. Also I have changed things so that page_reporting.h was split over two files with the new one now living in the mm/ folder. By doing that I was hoping to reduce the exposure of the internal state of the free-lists so that essentially all we end up providing is an interface for the notifier to be used by virtio- balloon. Thanks. - Alex [1]: https://lore.kernel.org/lkml/20191001152441.27008.99285.stgit@localhost.localdomain/