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=-7.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 9DC74C433E0 for ; Wed, 6 Jan 2021 00:07:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 318E222E03 for ; Wed, 6 Jan 2021 00:07:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 318E222E03 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 356658D00C7; Tue, 5 Jan 2021 19:07:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2E0BF8D006E; Tue, 5 Jan 2021 19:07:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1CE4B8D00C7; Tue, 5 Jan 2021 19:07:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0112.hostedemail.com [216.40.44.112]) by kanga.kvack.org (Postfix) with ESMTP id 031D08D006E for ; Tue, 5 Jan 2021 19:07:57 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id C4B74181AEF1A for ; Wed, 6 Jan 2021 00:07:57 +0000 (UTC) X-FDA: 77673412194.18.bead06_330dfef274dd Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id A938D100EC67B for ; Wed, 6 Jan 2021 00:07:57 +0000 (UTC) X-HE-Tag: bead06_330dfef274dd X-Filterd-Recvd-Size: 5184 Received: from aserp2130.oracle.com (aserp2130.oracle.com [141.146.126.79]) by imf35.hostedemail.com (Postfix) with ESMTP for ; Wed, 6 Jan 2021 00:07:56 +0000 (UTC) Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 10604jKt081856; Wed, 6 Jan 2021 00:07:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=J/YOMPAISoWCw/4a9GsBv0ENoQiezDgKQoXpHWXosMo=; b=Mr1LMciFlfwTjMqWiVtkAzi3nT1D8vtofUYMko4zEtLpoPRtffJn44pBsiu0Bk7GDxcy mQHvOxTx3dt/0+PciEFJGzOWk7KGg7adAdWTtynLEhZTSxmWLmgq8AKhZdroA8HeYPR5 51Q/hpv7PckrHJRXvjBbRGAaRw2flwg+XxZw4d89SG2QtXBr39XOE112Ia+XnR5i7CRJ ssyzHxg/kmx0GZdonEaKwmKU20eQCws08ubzilQX0sdI3JFZ6qqU+kDdVzsLrzCwNHgo c1fnHkszkoB+ELh1Sy6cfdFY3uNhjsWnxCT2padHjejiCqVLo+wLhHSrPbkzM1Wj9M4O JA== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2130.oracle.com with ESMTP id 35tebaubrd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 06 Jan 2021 00:07:51 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 10600lFV003405; Wed, 6 Jan 2021 00:07:51 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 35v1f9843g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 06 Jan 2021 00:07:51 +0000 Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 10607nkC027331; Wed, 6 Jan 2021 00:07:50 GMT Received: from [192.168.2.112] (/50.38.35.18) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 05 Jan 2021 16:07:49 -0800 Subject: Re: [External] Re: [PATCH 4/6] mm: hugetlb: add return -EAGAIN for dissolve_free_huge_page To: Muchun Song Cc: Andrew Morton , Naoya Horiguchi , Andi Kleen , mhocko@suse.cz, Linux Memory Management List , LKML References: <20210104065843.5658-1-songmuchun@bytedance.com> <20210104065843.5658-4-songmuchun@bytedance.com> From: Mike Kravetz Message-ID: <7b30ad06-aced-817c-181c-a2099ba08918@oracle.com> Date: Tue, 5 Jan 2021 16:07:48 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9855 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 suspectscore=0 spamscore=0 bulkscore=0 adultscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101050138 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9855 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 priorityscore=1501 spamscore=0 mlxscore=0 clxscore=1015 bulkscore=0 lowpriorityscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101050138 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 1/4/21 7:46 PM, Muchun Song wrote: > On Tue, Jan 5, 2021 at 11:14 AM Muchun Song wrote: >> >> On Tue, Jan 5, 2021 at 9:33 AM Mike Kravetz wrote: >>> >>> On 1/3/21 10:58 PM, Muchun Song wrote: >>>> When dissolve_free_huge_page() races with __free_huge_page(), we can >>>> do a retry. Because the race window is small. >>> >>> In general, I agree that the race window is small. However, worst case >>> would be if the freeing of the page is put on a work queue. Is it acceptable >>> to keep retrying in that case? In addition, the 'Free some vmemmap' series >>> may slow the free_huge_page path even more. >> >> I also consider the 'Free some vmemmap' series case. In my next >> version series, I will flush the work before dissolve_free_huge_page >> returns when encountering this race. So the retry is acceptable. >> Right? > > Hi Mike, > > How about flushing the @free_hpage_work when > encountering this race? Flushing should be fine. The more I think about it, the more I think spinning to retry is not going to be an issue. Why? As you mentioned the race window is quite small. It just makes me a bit nervous to retry in a tight loop. -- Mike Kravetz