Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4578877pxj; Tue, 8 Jun 2021 18:37:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+G8ibTXOyR+hZSN1niJwASkNRhHHloHXUWY1UztcWGs+5+0GF7znOL/wbk1XSuw/wcUuI X-Received: by 2002:a17:906:bfc8:: with SMTP id us8mr26140142ejb.217.1623202621987; Tue, 08 Jun 2021 18:37:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623202621; cv=none; d=google.com; s=arc-20160816; b=ui/L6lmCQerR6vMrp0QHbP3BsthacGiYQF9GpkpsBmL8o12heVsxcfe9+zofLgbG/0 5MolhewuDHakjrohki4tMK0kzGw8L4InNpGV5M3B4yY7VHNa36JHu5YpUIVYQqtvGh0R 46EukiFhYWCM/z3syHkdzr5rCWHIgs9UvaLiGuQxV1qWf9Ibjny7o3N6hS1yNEPrkADm Gf5bk4mJsqqDsid3M9rwiSNH02+l+fpiiY5h3eZe/DrrquOjt6Q4GTvVoS1FnXcb0TFn z/SuW+S08gYDvJr+7Wo1g36UMg9p8BNniOYwjCSMYn/7ejqJ3ov9GMdrXNdXcTFchEVB FXZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=JldEYX/aYDCuRQlAA13qtQYS64HOrhQMpjyRp9pf0Co=; b=HxpK+jOmG5Wb6d50JEz/uLTuySk8CVy3j+2p7Upz1xQslc1eC8cfQLSOzz72E7oRiv H27CbJ9pzyqGe/yeGYwf1CmPGAiggdhnyFXdW1I6NuNaCDKYb2WEwmhS8nHIeGSA2jQe 78KtbHdGMMns4+T1LsGImGYmwbBSSt8NJFgOAlwzs3NgdN1AUEgVDragDX5Z9jeMPPIC Fqy5iw59O87TdRjp8az8PURlHWlZD6rvoXpC9Gkf6pYVu5hnZ8xz0DWnJp5gpovUcMyC NBLBBmgP/CxV4g6tb+P1EuePg1tWLRYfw0Jrs2GcKUQR7QAUl3oVzjVoHjAtpKhF+ftW pb6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=FjLqjLPl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u21si1160943ejz.696.2021.06.08.18.36.38; Tue, 08 Jun 2021 18:37:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=FjLqjLPl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232614AbhFHNAd (ORCPT + 99 others); Tue, 8 Jun 2021 09:00:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230009AbhFHNAc (ORCPT ); Tue, 8 Jun 2021 09:00:32 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D2F2C061574 for ; Tue, 8 Jun 2021 05:58:26 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id t7so24832567lff.0 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=XBU+0xpoEWhnK/ku2mRGTcbX0buhDKXH3FxZjEdmPTs2HkvqSScXjNVpJ9vyxeYxLN l0vtxBM+J3R9NJaJUCGT7chhCR78/b1b1QUHrdhLvQbaXGIa6xTvJm31YEzxZwjh+fHE ULGjt+KWv03bWabL2iJlptP9kE8nyH3Xn/BimFLJQwREYlWksqQkP59O3KcFFoN24nuy nMd4d8/V6MVyyR0l5wvKAKGPb9q8Vx04h+4JT4x/rF4iZfwYKyGM5aykcxqNrLR81AKx JLLjNyfW0SorcerOGH99pdWtaJm+rw2LH3Ie33Ifx90yDnodNJ+lm/yNcxVVRb+2/VQk HNoA== X-Gm-Message-State: AOAM530Y3/eeDxJKUDIdHp2gIUmIxf0fI9arcuacVHtJx//vtzAE9342 wiyU5eyll2Fq9TRCcq7Lm6dklg== 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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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