From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-188.mta1.migadu.com (out-188.mta1.migadu.com [95.215.58.188]) (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 02AD33E3DBC for ; Wed, 5 Aug 2026 08:15:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785917753; cv=none; b=u6e5quganNBxudrvN6SRrcoqreYXOIb9pJycqmqBwy1DD64yFxdoCCWx4bhKe5zxEUoF3Zjlqle+rLroK+9Uvz1gEnB3RD1lY8oZT62hYHRhAj9Mu5PZSBRs1Ww8ouR1eZF+ZfNoxGgisQQdQ+xW9w7lEHDLQpu3calp+J7xl5c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785917753; c=relaxed/simple; bh=wfXWk2zvWnNGGpTHz/0ZieLgm+KGyuwKjYCyuFOi/SQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NTaUSZGuKlrfHck7CMvXpsTx6FFKN7Hvgpa5wmxGvHpyUlfVZAuOycR4sN7ibQG3BFlAQOQOzbE46Zz8TBVLivPRHOpeHY2pKte5R+WiyMC5un2kno3Ac5+3P3mFIP5GcCEYJ4H+DL/AyU7vIS6eKNuLCYolILFCn/YXR1Ko0f4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=kHT+RewT; arc=none smtp.client-ip=95.215.58.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="kHT+RewT" Date: Wed, 5 Aug 2026 16:15:34 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1785917745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lzmyTxvmXxprlAPCgRd0UqqVb7Yl/SSQCszNPTVuf6c=; b=kHT+RewTiod0knktRTZrH4gLYx9KBQgtTZlBLKpn8BzpMybhx8PJQcORpuSP/9NSdVMd1O DYuIZo5245/oIxf8v+YGysl9JfhluavOJUq05+VlF42Yg2ih1Im8PL4+J4V9HywHD6SYT9 dl3d23iKXZ6g/dQjZegWGZaNmaAOKmI= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Baoquan He To: Nhat Pham Cc: linux-mm@kvack.org, akpm@linux-foundation.org, chrisl@kernel.org, kasong@tencent.com, baohua@kernel.org, youngjun.park@lge.com, hannes@cmpxchg.org, yosry@kernel.org, david@kernel.org, shikemeng@huaweicloud.com, chengming.zhou@linux.dev, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 11/11] mm, swap: serialize xswap map/unmap with a mutex Message-ID: References: <20260727135029.1059441-1-baoquan.he@linux.dev> <20260727140503.1060918-1-baoquan.he@linux.dev> <20260727140503.1060918-10-baoquan.he@linux.dev> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Migadu-Flow: FLOW_OUT On 07/27/26 at 08:13am, Nhat Pham wrote: > On Mon, Jul 27, 2026 at 7:06 AM Baoquan He wrote: > > > > Concurrent xswap grow operations race on vm_area_map_pages(), > > triggering WARN_ON(!pte_none) in the vmap page table walk when > > one thread sees a PTE already set by another. The -EBUSY safety > > net catches it but the warning is noisy and unavoidable without > > serialization. > > > > Add a per-device mutex (xswap_lock) held across xswap_map_clusters > > and xswap_unmap_clusters so that only one thread can modify the > > VM_SPARSE page table at a time. The shrink path is already > > deferred to a workqueue so it does not contend with itself. > > > > Signed-off-by: Baoquan He > > Seems like this should be squashed into one of the older patches, no? Both is fine to me, because putting it in a separate patch can get a specific log to describe it with more details. Have squashed it into patch 03 as suggested since they are small number of lines of change. Thanks Baoquan