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 B8D74C47082 for ; Tue, 8 Jun 2021 12:58:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 39BD96134F for ; Tue, 8 Jun 2021 12:58:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 39BD96134F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7CB466B006C; Tue, 8 Jun 2021 08:58:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7A29F6B006E; Tue, 8 Jun 2021 08:58:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 66A206B0070; Tue, 8 Jun 2021 08:58:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0044.hostedemail.com [216.40.44.44]) by kanga.kvack.org (Postfix) with ESMTP id 386576B006C for ; Tue, 8 Jun 2021 08:58:27 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id C8CF78249980 for ; Tue, 8 Jun 2021 12:58:26 +0000 (UTC) X-FDA: 78230560212.30.1E008C2 Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) by imf13.hostedemail.com (Postfix) with ESMTP id 7AD04E000274 for ; Tue, 8 Jun 2021 12:58:23 +0000 (UTC) Received: by mail-lf1-f47.google.com with SMTP id j2so4316595lfg.9 for ; Tue, 08 Jun 2021 05:58:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=JldEYX/aYDCuRQlAA13qtQYS64HOrhQMpjyRp9pf0Co=; b=FjLqjLPlIHLSem+vV5sKU8qW82neKJqhwE7+nwzEChHnPW20Eze/aJtEh88RXS9pcP eOXHwToKwcGsgj85jPqu+c2DV+QfJuOQoZyxG9tO1fCdcbsqTgOYrb5+kRmDaeWSDFKB DKjcLb5T+hiFQRnp8V4M5d/FNt1yRQyKfXBS9Cbe16ZEYJXp2BCtsKs3xxjRhS9w/qpt S9EZAUNvblPfuIa/EI2G/jiSoAFJbQGB/KMYhqzNkvD1RXiMjwjC8jCSRZylnJt+/kXR 0PPyqtHJV6p8+/iYdviCsjX/VNyJO6R9cWACfhBiTFtF5MLf64/bdyBwvUdjNlddVHhn +CfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=JldEYX/aYDCuRQlAA13qtQYS64HOrhQMpjyRp9pf0Co=; b=hiEQt/pZJbsS151GCVK2zWVmxbbzlo16h4WKeY7d8SwuaBV7PIO6TkgMqaweLY3A+F Pfq+ndirXtKJaDaVpo8wk/qG27cr/9PlrLOfT4xMQtm0J9x2ysAKa6MkygJoIM1u4mLL wRmJPG8oE3GBdcsT4Jlasnr26mWEjdwBMFYggMrIIMp8sUubqzgC8z7OJrRW1Yxt3Otp jjRHFRMOWg02C2kNZsnYupG92j2tFAbYXuAdJfWf+bEN6T3IJamAvEqNsTGuisKMlGhg a+K9X9BpPM+Jcgz1kfD2d39qVZ2YKEq+VC+/2gg/Osk/riULbbXGYKRbWNp2BuqCQNSf /jMA== X-Gm-Message-State: AOAM531jpIY4yV72fKroYZs7nSqknM4lF9m20CdNwh5W1WiX+ZPbcoo5 ZRIQascZftwaUeinuVIj2VUdAw== X-Google-Smtp-Source: ABdhPJwiVHHdBJ2e3LGrPuYejYamakSP0GL5NIlStRaQlOKJEfCyp3m+7Ziws/FEP89lHi51O7ySVw== X-Received: by 2002:a05:6512:2397:: with SMTP id c23mr15324583lfv.114.1623157104947; Tue, 08 Jun 2021 05:58:24 -0700 (PDT) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id a14sm461743ljj.86.2021.06.08.05.58.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 05:58:24 -0700 (PDT) Received: by box.localdomain (Postfix, from userid 1000) id F3930102815; Tue, 8 Jun 2021 15:58:38 +0300 (+03) Date: Tue, 8 Jun 2021 15:58:38 +0300 From: "Kirill A. Shutemov" To: Matthew Wilcox Cc: Xu Yu , linux-mm@kvack.org, linux-kernel@vger.kernel.org, hughd@google.com, akpm@linux-foundation.org, gavin.dg@linux.alibaba.com Subject: Re: [PATCH v2] mm, thp: use head page in __migration_entry_wait Message-ID: <20210608125838.6ixdlz3t334gjnp7@box.shutemov.name> References: <20210608120026.ugfh72ydjeba44bo@box.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=FjLqjLPl; spf=none (imf13.hostedemail.com: domain of kirill@shutemov.name has no SPF policy when checking 209.85.167.47) smtp.mailfrom=kirill@shutemov.name; dmarc=none X-Stat-Signature: b4tgoy3zebnrigw19j47abgpt448eki3 X-Rspamd-Queue-Id: 7AD04E000274 X-Rspamd-Server: rspam06 X-HE-Tag: 1623157103-656936 X-Bogosity: Ham, tests=bogofilter, spamicity=0.009738, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Jun 08, 2021 at 01:32:21PM +0100, Matthew Wilcox wrote: > On Tue, Jun 08, 2021 at 03:00:26PM +0300, Kirill A. Shutemov wrote: > > But there's one quirk: if split succeed we effectively wait on wrong > > page to be unlocked. And it may take indefinite time if split_huge_page() > > was called on the head page. > > Hardly indefinite time ... callers of split_huge_page_to_list() usually > unlock the page soon after. Actually, I can't find one that doesn't call > unlock_page() within a few lines of calling split_huge_page_to_list(). I didn't check all callers, but it's not guaranteed by the interface and it's not hard to imagine a future situation when a page got split on the way to IO and kept locked until IO is complete. The wake up shouldn't have much overhead as in most cases split going to be called on the head page. -- Kirill A. Shutemov