Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2090458ybb; Thu, 26 Mar 2020 21:42:16 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsmUDqR9TSN1/MpPXnD6X+OkHikH4sWZka1fRBm8n06SR51VImHIk8IEDWZKQsyGkAcmCpL X-Received: by 2002:aca:f288:: with SMTP id q130mr2740712oih.33.1585284136559; Thu, 26 Mar 2020 21:42:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585284136; cv=none; d=google.com; s=arc-20160816; b=oGlOemRhA8gjipfUZY1bxHutwuBLUV+wb/RDoBkjYzRf1KlwtSiDlS4eSIyyotApJl /chpaHppWSf8rAY+LjjTUKMpBkNJjaDsjgRXobmBqWUo9Ni4rrJehGGTi1EPvRslgwa+ eSWzN5Jh7HWz5AnyTyBgGpUgzHcPFUDapKA0vs1AChD5DMz4UJrgdmjmDo4o0yVbCyzK HwGWTGsnjFD3gOoVTAc38kB4qCcnczcF+atyxBzAZIunf5SclvZ0HcFcdWX5aqIlVZRp NTjJY1vkvp4vk+iODsINzS67ylJc7luB1AYlgz3ZfTppz5DDZzpu/xKfHEG3gXfAvnRi nmVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=R910l/HRxSCzS1kBdoSJTwrk496A3sYloXogcUvPkNI=; b=rTeP77YUO2VrFQp4WNnwnYuUVryKuzHhj6Rju4B7ORIT2JDkrtBjAk8NpEgbpbtjjh xuU1oDRKR3k75iDKBMPHQbhYJ5SXtH8NbIOg8lOa1ArYWAiirDt+eolEmP0vGkpK16SC 5ABWgBP2Lxcl538Bk7hPjwFIms74A1IncDBeWrba5ptotoewwEixJmLXqhq1hbtc+YCC BXAYLgJzzas69lbYrqOEQ6ajC3RbtuuTfjeBdrqIkhg1qdg6A1ku5a/xeFW60FLJqzms ozLisCRL5O1yh7kJwSNc+KG3TaSw7hrOM+XLurZaKlZVOwURfZ5ntzfzBhkkfMANvQLS d02g== 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=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i15si2062244ots.121.2020.03.26.21.42.03; Thu, 26 Mar 2020 21:42:16 -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=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726027AbgC0Ell (ORCPT + 99 others); Fri, 27 Mar 2020 00:41:41 -0400 Received: from out30-42.freemail.mail.aliyun.com ([115.124.30.42]:40430 "EHLO out30-42.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725904AbgC0Elk (ORCPT ); Fri, 27 Mar 2020 00:41:40 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01358;MF=shile.zhang@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0Ttk74ST_1585283958; Received: from ali-6c96cfdd1403.local(mailfrom:shile.zhang@linux.alibaba.com fp:SMTPD_---0Ttk74ST_1585283958) by smtp.aliyun-inc.com(127.0.0.1); Fri, 27 Mar 2020 12:39:19 +0800 Subject: Re: [PATCH v3] mm: fix tick timer stall during deferred page init To: Pavel Tatashin , Daniel Jordan Cc: Andrew Morton , Kirill Tkhai , linux-mm , LKML References: <20200311123848.118638-1-shile.zhang@linux.alibaba.com> <20200319190512.cwnvgvv3upzcchkm@ca-dmjordan1.us.oracle.com> <20200326185822.6n56yl2llvdranur@ca-dmjordan1.us.oracle.com> From: Shile Zhang Message-ID: <427ce795-0274-56e5-16e4-7be00c7145f7@linux.alibaba.com> Date: Fri, 27 Mar 2020 12:39:18 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/3/27 03:36, Pavel Tatashin wrote: > I agree with Daniel, we should look into approach where > pgdat_resize_lock is taken only for the duration of updating tracking > values such as pgdat->first_deferred_pfn (perhaps we would need to add > another tracker that would show chunks that are currently being worked > on). > > The vast duration of struct page initialization process should happen > outside of this lock, and only be taken when we update globally seen > data structures: lists, tracking variables. This way we can solve > several problems: 1. allow interrupt threads to grow zones if > required. 2. keep jiffies happy. 3. allow future scaling when we will > add inner node threads to initialize struct pages (i.e. ktasks from > Daniel). It make sense, looking forward to the inner node parallel init. @Daniel Is there schedule about ktasks? Thanks! > > Pasha > > On Thu, Mar 26, 2020 at 2:58 PM Daniel Jordan > wrote: >> On Thu, Mar 19, 2020 at 03:05:12PM -0400, Daniel Jordan wrote: >>> Regardless, >>> Reviewed-by: Daniel Jordan >> Darn, I spoke too soon. >> >> On a two-socket Xeon, smaller values of TICK_PAGE_COUNT caused the deferred >> init timestamp to grow by over 25%. This was with pgdatinit0 bound to the >> timer interrupt CPU to make sure the issue always reproduces. >> >> TICK_PAGE_COUNT node 0 deferred >> init time (ms) >> --------------- --------------- >> 4096 610 >> 8192 587 >> 16384 487 >> 32768 480 // used in the patch >> >> Instead of trying to find a constant that lets the timer interrupt run often >> enough, I think a better way forward is to reconsider how we handle the resize >> lock. I plan to prototype something and reply back with what I get. Yes, the time spend of pages init depends on the CPU frequency, and the jiffies update controlled by HZ, so it's hard to find a general constant. It seems we need a bigger refactors about the lock to get a better solution.