From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86491C43331 for ; Fri, 27 Mar 2020 04:39:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A5B1A206F2 for ; Fri, 27 Mar 2020 04:39:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A5B1A206F2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 165156B0010; Fri, 27 Mar 2020 00:39:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 116176B0032; Fri, 27 Mar 2020 00:39:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 02B516B0036; Fri, 27 Mar 2020 00:39:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0099.hostedemail.com [216.40.44.99]) by kanga.kvack.org (Postfix) with ESMTP id DB1AB6B0010 for ; Fri, 27 Mar 2020 00:39:25 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id AC988181AD0A0 for ; Fri, 27 Mar 2020 04:39:25 +0000 (UTC) X-FDA: 76639888290.26.quiet22_8c65858781a3e X-HE-Tag: quiet22_8c65858781a3e X-Filterd-Recvd-Size: 3998 Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) by imf33.hostedemail.com (Postfix) with ESMTP for ; Fri, 27 Mar 2020 04:39:24 +0000 (UTC) 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.