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=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 5A037C433DB for ; Wed, 13 Jan 2021 12:16:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id ABA332076A for ; Wed, 13 Jan 2021 12:16:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ABA332076A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BB8F48D0049; Wed, 13 Jan 2021 07:16:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B68FE8D002E; Wed, 13 Jan 2021 07:16:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A58FA8D0049; Wed, 13 Jan 2021 07:16:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0111.hostedemail.com [216.40.44.111]) by kanga.kvack.org (Postfix) with ESMTP id 906058D002E for ; Wed, 13 Jan 2021 07:16:28 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 5AB351EF3 for ; Wed, 13 Jan 2021 12:16:28 +0000 (UTC) X-FDA: 77700649656.26.ship77_010c8ca2751e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id 2C2131804B656 for ; Wed, 13 Jan 2021 12:16:28 +0000 (UTC) X-HE-Tag: ship77_010c8ca2751e X-Filterd-Recvd-Size: 4687 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by imf12.hostedemail.com (Postfix) with ESMTP for ; Wed, 13 Jan 2021 12:16:27 +0000 (UTC) Received: by mail-pl1-f181.google.com with SMTP id j1so976660pld.3 for ; Wed, 13 Jan 2021 04:16:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=a5W2wNZZKJZwsE86ZoW5+zbor2DhuPLMBAueklRl0b0=; b=xbXwyAIjyM97eOkk4+dSEuUvNacL2rj0frgu2asCQhXxQNJqcedtkO+BBrDSIHZ59y izm1yVtNpVKPHSqWrjyy8K96X6JUVIAfefzf2FAuS/kZP+N2p1HfkPLJTKmnNL8LbgId kw69KIIfA/7nq0l0BCyBJUzkAWiJI0Wm0kzAIU6vsH8YfxoJ1uN6jPpqFO2gqeQNeykP TPJ2aVKjPU87k0F1oqKt/Xy3CeewvJk6jYxA4Z8iNAsLr0rnkGaK8gBXnwwus2wPWciN x4FkLLrJjKH1v8/dmVwi+IEgijUe9AzND3OmIZX8v2DJKs4FtK7UiM3X3slDlQKetV11 EQWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=a5W2wNZZKJZwsE86ZoW5+zbor2DhuPLMBAueklRl0b0=; b=Vs8XXIP83KTgt5rSMuHGCo9d9K6z0bhawX7KcIB+WK+fPf8YCJRrmM765Cp1MaCz1F Wx61nGgfoTZGXKZ35oSpkSfamQmhbLIGOvunviH+JiHOfVvblR1ZiEKwcemMRwEFJVNs +vYjxz/xXIlr+F11nmlx/penOwDwB6IP4ldmUay5pm60PSrWTk8EMUgeN984tdlzY4Jq pLais8OZucId+qgdIrt1R3HbIBeDPcN9ZI/bA5hCVBF3fEwXnRjIHr7L4wJGe/O5L308 ZyWak++uodYWSGSahMSeBjHMSmtk5pkyjD61OJNLDc6ifOWe/81S8/jV19M5LAL1uXJZ sJLg== X-Gm-Message-State: AOAM531NpVIDa/U/4J/s4L241p+LlnZHLqzicN1tSQr6IIn5YQ+3Bodl QSOUoHVi6ezEoGwajMfNUzUSl8ENIlTsKpFowZ9dKg== X-Google-Smtp-Source: ABdhPJwTuXkFaHwl2vuqjUg1+rrxzQx2CdmGrJx2w61EvPyVJ/1vLbSBQPHNfyA/AjTnlOkByDvWRfVp9nHhTd90Rn0= X-Received: by 2002:a17:90a:5405:: with SMTP id z5mr2154213pjh.13.1610540186159; Wed, 13 Jan 2021 04:16:26 -0800 (PST) MIME-Version: 1.0 References: <20210113052209.75531-1-songmuchun@bytedance.com> <20210113052209.75531-5-songmuchun@bytedance.com> <20210113093331.GV22493@dhcp22.suse.cz> <20210113103836.GW22493@dhcp22.suse.cz> <20210113112201.GX22493@dhcp22.suse.cz> In-Reply-To: <20210113112201.GX22493@dhcp22.suse.cz> From: Muchun Song Date: Wed, 13 Jan 2021 20:15:47 +0800 Message-ID: Subject: Re: [External] Re: [PATCH v4 4/6] mm: hugetlb: retry dissolve page when hitting race To: Michal Hocko Cc: Mike Kravetz , Andrew Morton , Naoya Horiguchi , Andi Kleen , Linux Memory Management List , LKML Content-Type: text/plain; charset="UTF-8" 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, Jan 13, 2021 at 7:22 PM Michal Hocko wrote: > > 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. OK. I will do this. Thanks. > -- > Michal Hocko > SUSE Labs