Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp772960rdb; Thu, 22 Feb 2024 21:56:40 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWHsDLfI0y2SXC/MotEzVwumWZnjeHt6rBDFKrZ0NLGIdD7DkloQ82p+5xol/IHdrkHGMaVVym9toG4oH/8rW8GDBBuxuCC2uN9w6850w== X-Google-Smtp-Source: AGHT+IEmcQcXbWoDyxY9GMnNRNdaFd3npIIzie54IFULbYQ8XmnfSE9eEIppGpmCbQO+fXbtHleJ X-Received: by 2002:a0c:f04d:0:b0:68f:c85b:e77 with SMTP id b13-20020a0cf04d000000b0068fc85b0e77mr1250492qvl.17.1708667800517; Thu, 22 Feb 2024 21:56:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708667800; cv=pass; d=google.com; s=arc-20160816; b=Lng0bALAc2hQb98eNpm56RMDOqN1/dh9cpjgNrdVxHasLka1SMpDdLK+24AlWdeD32 qHriKb1+8VfDGigVNyI3H4uln10y/8C20oERLZc57OxOZMchQMI2pirRS5sIUlYYMXql gVPjZEsdsjpnR6Ehl9JNna6zQiYrV6C+Mh2OANtPIGAXnNahEIcIcftUKJTbb1csh8gB OAJwQuhMRNlJBAGSYhVE5pDvXQGOv8rGSEhiWurbc3P/+X++LuGWC337sLNDz2/AUfu2 TfqGaNsKEe77vgQBEJOPGItkrAjQCqsiv1xSUAw3OthFUfls5XT/lR7m+blDhr5W/i8O EfSQ== 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=N0GRTyFRup/uDSwIpNY903bhAXEkCVn4KPWPZ3fepfE=; fh=zVLYuP91u5Lkg7+boO9N1NvkLUi0xu8zdWQVvCDWEGI=; b=aEM+X9M59xGD6te12b/Sl2UMbSQlhPpsqnRz91EEJcI2gsK5npljV6QpuWXuW///oK 75Tg++y2CQbbtE+c4WeISYmpvpgOUJq8Kn6XPVIda21VzOyxqKU3PsQoJQBTogZTLON0 DG0DGCQbrjC8VVBFkH6g1j8U2PxOaIIJXY1KLpjafB6pejO3fpxx3VQIy3URcVl5Q+Ba nLzybyhwotDfrg1ZDo0U2h6Npv8AKVsRYHNnW+Z9y+LvLruZP1ACn6ZMiyuRjqZPoIDS TH4f5bugcI+gA98iCRF469/ak3TOgwzIdL6TYxGku2dOiDagQ7FriHAFmHiAtq2u/a9c zfNg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ixdwQJAj; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-77812-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77812-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id e10-20020a0562140d8a00b0068fb887fbd1si3016296qve.393.2024.02.22.21.56.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 21:56:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77812-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ixdwQJAj; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-77812-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77812-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3E7671C2291D for ; Fri, 23 Feb 2024 05:56:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9A9ED125A8; Fri, 23 Feb 2024 05:56:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="ixdwQJAj" Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 727D6B66B for ; Fri, 23 Feb 2024 05:56:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708667793; cv=none; b=SOE2k0zzYLpxKxHnmIf//MkDbtigpycvi3k8KJ4BoTVyWrwQivXHMKVRPRWo8OHYMGNhkKXfNvmi/GvOKo/2+D44L4eLnOt8oDem4lP+coQpBLUFT5TlPLiRS5RCiBTUXrGcWFINzuxyOtfgw85g0BvFaVtkX8BiR6R2rBX4Raw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708667793; c=relaxed/simple; bh=2eOqefi0VNZTnhkQdFC1j9jqkfL5vkky5ce0kHNNgTw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jePlP7CQ1oKBTdtqaQKxq4sd6bGbTbVKOFofMrS90m6UkF2ReN6VaL5WENe9vG4UTvT995/Rv78dSZbovy32Yn7v8kVvHnBjvHmLolE8h1Z6yZnfpqVANy+IdyQDJiUbh3tu13Ta/Afio9Eg0uWAodODQbqeVXbiZBnU6FKlqbE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=ixdwQJAj; arc=none smtp.client-ip=209.85.210.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-6e4e2380588so129460b3a.3 for ; Thu, 22 Feb 2024 21:56:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1708667792; x=1709272592; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=N0GRTyFRup/uDSwIpNY903bhAXEkCVn4KPWPZ3fepfE=; b=ixdwQJAjGm/iWFc3Odygk94qSEtmvFa2K24GNF89p7dIi1+eC+2IvRb0SGtfbiFPTi 5toAfl1AW9Y9gBZ6jIvt2wrLnDsBgCdlhgJaScvInxfvBrLXVIkIq4e8XEK4x/SdTBFr yBAsEkEtY2+3qKoa6/BFo/5nvZv9XbivX/jM0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708667792; x=1709272592; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=N0GRTyFRup/uDSwIpNY903bhAXEkCVn4KPWPZ3fepfE=; b=qXGD6Ypyj2NdQU/4/q47E9DQ8K9PMl7UjzoaVhrSrjOy7VDyeAQYqMn26iAijbCUTS vQ/sjIb5fapaV5MzNIk25twG9AFXiOw1d1gZfMoxiEbLZSbpWAq65WltiaRzAdb3N6LN RgmZrQzaDWp1Ycfq78LZ1TaR7Jc0//fGCXSLSPKzlkO6Gdq8B4+8B8sgYn/+UPhI6gjF YfudJB+yN8p0a2O4ikuQAZDJ6QsKwsPPjtMkSjpUAe4Cf8IWiAsNrMqEtwT9GAKO6WXm hKE9HvGVDQ2ZkS5QWe/IsHhmjoyeIMaeTmh+/kyRrtlLQyzAz643ghuFB2OOtSmGhpIQ zcjg== X-Forwarded-Encrypted: i=1; AJvYcCVGmlvX/5vMyZ+PD0n3nyTanwGrFmELzCA5XlYjogCQqRWqmAgNoVDTLgSPzrSVSkByiw+tjbrZFaM1A1h+ryG7QKJRN2/j1oPIGIip X-Gm-Message-State: AOJu0YySvXs6nBg1HcRN7m1bCglpUgITY2idKWZbwiLZfNSjTprHfXB4 5VpWG46MUqjQggb/zzaM0JQBqyp1/cFhury/+DCVX7qEzsKFx3QMfVgRCFtppQ== X-Received: by 2002:a05:6a21:278a:b0:1a0:e089:e25e with SMTP id rn10-20020a056a21278a00b001a0e089e25emr715788pzb.46.1708667791830; Thu, 22 Feb 2024 21:56:31 -0800 (PST) Received: from google.com ([2401:fa00:8f:203:b194:4f71:568a:eeb0]) by smtp.gmail.com with ESMTPSA id x92-20020a17090a6c6500b00298d8804ba8sm557787pjj.46.2024.02.22.21.56.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 21:56:31 -0800 (PST) Date: Fri, 23 Feb 2024 14:56:26 +0900 From: Sergey Senozhatsky To: Chengming Zhou Cc: hannes@cmpxchg.org, Sergey Senozhatsky , Minchan Kim , Andrew Morton , nphamcs@gmail.com, yosryahmed@google.com, linux-mm@kvack.org, Chengming Zhou , linux-kernel@vger.kernel.org Subject: Re: [PATCH RESEND 2/3] mm/zsmalloc: remove migrate_write_lock_nested() Message-ID: <20240223055626.GV11472@google.com> References: <20240219-b4-szmalloc-migrate-v1-0-fc21039bed7b@linux.dev> <20240219-b4-szmalloc-migrate-v1-2-fc21039bed7b@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=us-ascii Content-Disposition: inline In-Reply-To: <20240219-b4-szmalloc-migrate-v1-2-fc21039bed7b@linux.dev> On (24/02/20 11:36), Chengming Zhou wrote: > From: Chengming Zhou > > The migrate write lock is to protect the race between zspage migration > and zspage objects' map users. > > We only need to lock out the map users of src zspage, not dst zspage, > which is safe to map by users concurrently, since we only need to do > obj_malloc() from dst zspage. > > So we can remove the migrate_write_lock_nested() use case. > > As we are here, cleanup the __zs_compact() by moving putback_zspage() > outside of migrate_write_unlock since we hold pool lock, no malloc or > free users can come in. > > Signed-off-by: Chengming Zhou Reviewed-by: Sergey Senozhatsky