Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp106677lql; Fri, 12 Apr 2024 05:24:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU2m+ydCpr3CA75kzE9c/+tOI5GCJD62WeAKyvL39+U7IuJ+5vjyCO3dEcOfV0r4smZJJy+9MztxB8eFJc7kKViomLEcHBWaTtvlWCzLQ== X-Google-Smtp-Source: AGHT+IFCrWUOke5UpWHEt3yT3kXEso990gMebimCqt540H+KHBR+HfGKlzIIxuFdUxaO7ZH5tg0s X-Received: by 2002:a17:90a:9af:b0:2a5:3e4e:29a0 with SMTP id 44-20020a17090a09af00b002a53e4e29a0mr2264513pjo.6.1712924696501; Fri, 12 Apr 2024 05:24:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712924696; cv=pass; d=google.com; s=arc-20160816; b=wZ2EOlMnmEHzGkSvoiPm+gJmzXDTILPIRuZYWxrZOiUFtegSnuPhmoI5VostwGrTOw rzms01VYMBIqI4Vir2Qt8fmYBkGbnoxb6M8oFutEFxvlEafKYyTSEXo2Yuv659BjycAz NM37UjSNUEkVDaef7NeXw0udW0PUknhpt5A5kt5yRpAMrpkqgTxa3nvCADrZyOTg3XLo Qj8SOrh+yNGVBI3j1x399X2Zlj7qiDxX373tm+jkaEbxLsAKMU51uO1wYWVRNA/BdRSY NfMTzy5joUWyJ1vgk+BNqGUD6XXc3qAA6TA7aUi+4aI0wsXlpL9dbHL1ztljEndQX+E/ RDXA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=V8tHIi8mtmD3siYN748Lkzi4LVwXGCeJa+lIehzP4co=; fh=ML/aHXRGtoazeU37RIUSD+6VdxiNDsGPPCMhI8QgCEI=; b=e/JiJH2DBXZCIyBi4XldcsxVEaCBzXyU3ZBXjZaoa6XPX6yZl84+FPclWpwpTMJe4N DgwAbNR5kuwrqcz6gt702snMW4xPNq6tXfnIoObWivFdBri3zf58ULt6NwJqb/BtmhXG Sdx9f++xwpozpc3H5kN1u0M70G2RlslfTqqf1EHoxuToawLcqLIxKfiJDfblKHcv+vdr 0mu3igLNMwMEfEQFnqdpR0TL+v3POJpwt9etttaWO+YpFmvE6OV/G2tajqXpnmZjJgs5 GtZnTUsT5fKXndbL0f79OF0Xphb1D6iZftMvXcjrQli7f8EGXvw5eTrk4NlkHIx28uq1 igIg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=uWkCeV4y; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-142641-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142641-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id i18-20020a63cd12000000b005dcbb9ab5b7si3039662pgg.277.2024.04.12.05.24.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 05:24:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142641-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=uWkCeV4y; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-142641-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142641-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E7079284298 for ; Fri, 12 Apr 2024 12:24:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2C3065646D; Fri, 12 Apr 2024 12:24:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="uWkCeV4y" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2B22C55E56 for ; Fri, 12 Apr 2024 12:24:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712924690; cv=none; b=Y+Oi7XPUmS42/UKdQKlkKfMOaTJTpAh1Owzpi76DHDoPPiqmjG3ZZx0J1l0x4tErgJiVpjKxpfHNgyMvAdRbXH7LsTzzkkMGGvKvfYJzlBNHJXZqidsbwkK08IA26tihemhTaHDDwClXu5+gMQF0/SeiYhTF9SQsstMb3qBxkmo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712924690; c=relaxed/simple; bh=l84tKIYFJRbNO3lPZNfB9URMCjMjbQfpQxdw4xzI+ZQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sizKg3GkNUxOpeMhOV8Il0bOOR9/jU3X2Dl+Ue3HWXUWvf/aV3jM4n8aDqDKe98o+PsFxmCE+1Wmprj4XzRxLvpxI96ZIGWr3tg8YVCeFfbl/8ns+zYogKJ/vgEFMxLUcl3QwEJWc3OlcjrD9UiLp69ci083cgdTlHk3V6CutHs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=uWkCeV4y; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=V8tHIi8mtmD3siYN748Lkzi4LVwXGCeJa+lIehzP4co=; b=uWkCeV4ysT2+I4xSNxZgjS/hDW O0MYpnRf2G3nZscjAqThdwQD6jkYNEpjVypoLlkvW6o0CubwwU4bn3HQgwXxqE2bkpyvzE1YCRI6e xfKZwJDOlZ9qrqrqi1JS1OBvNoXQbDA/d0lpIBHq8igi5ZbiNF6tlvh3YHmbMMyfLTXduF7KjlDyy 8pF7x+/i2qveYWxGRGWmo8R6NHtfURZDYaTFE38szNynHh3vD3NpOnHi2Zev5QAE0Pzii85oL1mr3 cx/C/CLXXuGXJ+bfOSvRVP6gnMN4/mWHOVvjBs1c7fu0EvEXJUrDSO5eIhdAw/2qRfOzbbgfMmKeC DubM335Q==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rvFxM-0000000986C-2SQq; Fri, 12 Apr 2024 12:24:36 +0000 Date: Fri, 12 Apr 2024 13:24:36 +0100 From: Matthew Wilcox To: "zhaoyang.huang" Cc: Andrew Morton , Alex Shi , "Kirill A . Shutemov" , Hugh Dickins , Baolin Wang , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Zhaoyang Huang , steve.kang@unisoc.com Subject: Re: [PATCH 1/1] mm: protect xa split stuff under lruvec->lru_lock during migration Message-ID: References: <20240412064353.133497-1-zhaoyang.huang@unisoc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240412064353.133497-1-zhaoyang.huang@unisoc.com> On Fri, Apr 12, 2024 at 02:43:53PM +0800, zhaoyang.huang wrote: > From: Zhaoyang Huang > > Livelock in [1] is reported multitimes since v515, where the zero-ref > folio is repeatly found on the page cache by find_get_entry. A possible > timing sequence is proposed in [2], which can be described briefly as I have no patience for going through another one of your "analyses". 1. Can you reproduce this bug without this patch? 2. Does the reproducer stop working after this patch? Otherwise I'm not interested. Sorry. You burnt all my good will. > the lockless xarray operation could get harmed by an illegal folio > remaining on the slot[offset]. This commit would like to protect > the xa split stuff(folio_ref_freeze and __split_huge_page) under > lruvec->lock to remove the race window.