Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4571383ybb; Tue, 14 Apr 2020 09:50:56 -0700 (PDT) X-Google-Smtp-Source: APiQypKd4BZvbXrOREC3zwb2+3R/pqCpddd9ny4spSbRuoEKqH/de5ol7N/DDPAiet8nlprJOiMH X-Received: by 2002:a50:d308:: with SMTP id g8mr21241940edh.88.1586883056490; Tue, 14 Apr 2020 09:50:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586883056; cv=none; d=google.com; s=arc-20160816; b=hqX3m6gsXODLJrt3LpCMUOxqAQS6whvAxBxWf1qLOZobyoVKIw+1kZjifEgZJd9aAA MbabSPw29YeqSKpwH9moEEgs1OV9yqmr1UdSQqaz55tWXltvLzgninSwwbYMvv15s5Of 7htIAx9FnZ35cQ8H9fAfD63Q57xHvVU4eb/vl9fH0UTXPCmNdjwi+pY8nSwVg4MteI+j 8uTjWkjhjUtmRr9fJ5YtgdLYR+BnrCzclLwL9WEeUb9cF+C1x8226QcZuqIJHXs9XEIT XOO/shXv2EJTwPjw/fSVvrJ649tLtBHGjBZkrio8sx0Dw6kCypXhoLLt8i/6nkcvJeRH s1rg== 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:dkim-signature; bh=6eY4SulE79/R6CaiMVLknysTXv5mXE1bPdiZhdn/9Eo=; b=ygFYd4L4pmY+E0zdpR4IkFotDjd180qN1mbrLQE+TmaL1V+s1AcoA9HLJi/S1xk6zk Z2gOxFD/hEJs+OoukfU0DctSlZ8hhEYzmj7rKZHpxboK2Mi3bWqqlYgCoLrl/zXvlIyl sx4srZHEIPuzLQ9rYT+dBYsySTdbk/sm5TcUMC40jVjZz50K93IAgE7cx5TLgqAHh+jO mnYthe3AbbTuaGUa1yufaZY193ekUV/nPeypVZf7tbWrdNcs9uHRyekE36XEf4TPoqtk XXCJVt1KNGUIHIXdP6PoEVSptqIVJudRlqzmw/J05yw5KgZDfuJVyUSiU8JmBwlRuqs7 +0eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=TOOXbq7T; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cw10si5673550ejb.369.2020.04.14.09.50.32; Tue, 14 Apr 2020 09:50:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=TOOXbq7T; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2440713AbgDNPlE (ORCPT + 99 others); Tue, 14 Apr 2020 11:41:04 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:39116 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2440652AbgDNPkH (ORCPT ); Tue, 14 Apr 2020 11:40:07 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 03EFS5df015987; Tue, 14 Apr 2020 15:39:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=6eY4SulE79/R6CaiMVLknysTXv5mXE1bPdiZhdn/9Eo=; b=TOOXbq7TN3JIcLnVi2iCsAWLMbjOiXrgkbeIw4HbKF6bfDMKY4tMpJRX7LSOzyBPTlp1 W9jx4cRKgkLIQBEhpRxQpBE8WUWITraPuFJT+VtaGt9q5FQnZ6g/7BW+YE2xds/K2j8y p5vs9SfLlUAF+vtHvEn4CkLx/Xd3F9Udm9n60fIPFffjKVia1aICNPx6s2CeF/qQAb4H CM6ceVawKcQKSyc0hNbC0a2736FC+Iu/G2M0tdJ7OHEOhV4OSve6VTToFUWNiwXbkh/L ImK19AQeG4YgdVozDy5j32aanYgerNqxK+9hUoPOfwtte0iN3ikTvY6BXTafhz0WXhye BQ== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 30b5um5k6f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 14 Apr 2020 15:39:52 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 03EFbFWJ178275; Tue, 14 Apr 2020 15:39:52 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3030.oracle.com with ESMTP id 30ctaag5un-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 14 Apr 2020 15:39:52 +0000 Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 03EFdnnf031915; Tue, 14 Apr 2020 15:39:49 GMT Received: from ca-dmjordan1.us.oracle.com (/10.211.9.48) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 14 Apr 2020 08:39:48 -0700 Date: Tue, 14 Apr 2020 11:40:05 -0400 From: Daniel Jordan To: Alexander Duyck Cc: David Hildenbrand , Alexander Duyck , Mel Gorman , linux-mm , LKML , Andrea Arcangeli , Dan Williams , Dave Hansen , Michal Hocko , Andrew Morton , Alex Williamson Subject: Re: [RFC PATCH 0/4] mm: Add PG_zero support Message-ID: <20200414154005.ttgsfux6vshjfhco@ca-dmjordan1.us.oracle.com> References: <20200412090728.GA19572@open-light-1.localdomain> <7de81a1c-0568-b8dd-02c5-b109a2e74a04@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9591 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 suspectscore=0 spamscore=0 adultscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004140124 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9591 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 clxscore=1011 bulkscore=0 mlxscore=0 mlxlogscore=999 lowpriorityscore=0 impostorscore=0 adultscore=0 phishscore=0 spamscore=0 suspectscore=0 malwarescore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004140124 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 14, 2020 at 08:07:32AM -0700, Alexander Duyck wrote: > On Tue, Apr 14, 2020 at 5:01 AM David Hildenbrand wrote: > > Having that said, I agree with Dave here, that there might be better > > alternatives for this somewhat-special-case. > > I wonder if it wouldn't make more sense to look at the option of > splitting the initialization work up over multiple CPUs instead of > leaving it all single threaded. The data above was creating a VM with > 64GB of RAM and 32 CPUs. How fast could we zero the pages if we were > performing the zeroing over those 32 CPUs? I wonder if we couldn't > look at recruiting other CPUs on the same node to perform the zeroing > like what Dan had originally proposed for ZONE_DEVICE initialization a > couple years ago[1]. This is exactly what I've done for VFIO. Some performance results: https://lore.kernel.org/linux-mm/20181105165558.11698-10-daniel.m.jordan@oracle.com/ and a semi-current branch is here if anyone wants to test it: https://lore.kernel.org/linux-mm/20200212224731.kmss6o6agekkg3mw@ca-dmjordan1.us.oracle.com/ One of the issues with starting extra threads for paths triggered from userspace such as VFIO is that they need to be properly throttled by relevant resource controls such as cgroup (CPU controller especially) and sched_setafffinity. This type of control for kernel threads has another use case too, async memcg reclaim. All this is second on my list after I post a series that multithreads deferred page init and sets up the basic infrastructure for multithreading other paths, which I hope will be ready soon. > [1]: https://lore.kernel.org/linux-mm/153077336359.40830.13007326947037437465.stgit@dwillia2-desk3.amr.corp.intel.com/ I haven't looked closely at memmap_init_zone, though I've tried memmap_init_zone_device. Will take a closer look to see how well this could be incorporated. Daniel