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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 3387AC433DB for ; Wed, 13 Jan 2021 11:22:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B77A523382 for ; Wed, 13 Jan 2021 11:22:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B77A523382 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 24B8E8D0041; Wed, 13 Jan 2021 06:22:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1FA838D002E; Wed, 13 Jan 2021 06:22:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0EAF98D0041; Wed, 13 Jan 2021 06:22:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0063.hostedemail.com [216.40.44.63]) by kanga.kvack.org (Postfix) with ESMTP id ECE4B8D002E for ; Wed, 13 Jan 2021 06:22:04 -0500 (EST) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id B5476180AD80F for ; Wed, 13 Jan 2021 11:22:04 +0000 (UTC) X-FDA: 77700512568.20.sheet08_47099942751d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id 841F6180C07A3 for ; Wed, 13 Jan 2021 11:22:04 +0000 (UTC) X-HE-Tag: sheet08_47099942751d X-Filterd-Recvd-Size: 3324 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Wed, 13 Jan 2021 11:22:03 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1610536923; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BERZzqS3AsWI9fkOEv6JI4kHq6LvsjxZvila2Ua7qOA=; b=fDRKWR84ed7mn2oLjc1fpmb+rNDnDvgFN1pzXTSpqgPd3HlHhfK8vdPNjg4Ga9xLU96GrS 0P9OZ4BnjIUQUdYsN/bNs2MDVA33Yw62HKteSLs/ZlqEjYnOjurK2oBG8qvN/VIjcYMWmP pB73oTqIPRGTWVeYzi956G9dkLIvl0s= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id E52ECAB92; Wed, 13 Jan 2021 11:22:02 +0000 (UTC) Date: Wed, 13 Jan 2021 12:22:01 +0100 From: Michal Hocko To: Muchun Song Cc: Mike Kravetz , Andrew Morton , Naoya Horiguchi , Andi Kleen , Linux Memory Management List , LKML Subject: Re: [External] Re: [PATCH v4 4/6] mm: hugetlb: retry dissolve page when hitting race Message-ID: <20210113112201.GX22493@dhcp22.suse.cz> References: <20210113052209.75531-1-songmuchun@bytedance.com> <20210113052209.75531-5-songmuchun@bytedance.com> <20210113093331.GV22493@dhcp22.suse.cz> <20210113103836.GW22493@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Wed 13-01-21 19:11:06, Muchun Song wrote: > On Wed, Jan 13, 2021 at 6:38 PM Michal Hocko wrote: [...] > > > I just want the fix patch to be small enough. > > > So I do the retry in this patch. If you do not agree with this. I > > > will fold this into the previous patch. > > > > > > Do you mean this? > > > > > > cpu_relax(); > > > cond_resched(); > > > cpu_relax(); > > > > No, I am questiong the use of cpu_relax. What is the point? > > If there is no task to be scheduled. Here is just a while loop. > The cpu_relax is a good thing to insert into busy-wait loops, > right? Well in an ideal world we would simply have a way to block and wait for the particular page. This is probably an overkill for a rare event like this. And while you are right that theoretically there might be nobody else to run but I find it rather unlikely considering that this path is racing with somebody. Sure there is even less likely possibility that the race is actually waiting for worker context but really I would just make it simple retry loop. If we ever hit a real busy loop then this would be pretty straightforward to spot and fix up. It's not like I am against the patch with cpu_relax but I find it excessive for this purpose. If you feel strongly then just keep it. Once the two patches are squashed I will ack it. -- Michal Hocko SUSE Labs