Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp523309rwb; Tue, 25 Jul 2023 20:59:20 -0700 (PDT) X-Google-Smtp-Source: APBJJlGng8Dd5ADqypyLSFxtXmAeuoBqJ++JlVzgiBDeDMQ0dMecy3hGdLrDsuefDWPgiBU3MkdW X-Received: by 2002:a17:906:30c7:b0:994:17e3:2753 with SMTP id b7-20020a17090630c700b0099417e32753mr614376ejb.26.1690343960264; Tue, 25 Jul 2023 20:59:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690343960; cv=none; d=google.com; s=arc-20160816; b=ZLECoYdOdtnL5urDd6PpiOAgEKfkXr5fSy/9nGGdl5msmY2xysYoS2oZDytyBLpxnP H+feo7GG44Xc6fQAwPo5NN0v23obopKnNLcJ17KYVt/3EnVy2mTqod0a9BImddaumLt8 OfokB8ugvbTN1PKsXG+mgpuuA5npldpj9ExyUwZewM3pO5U9z3YqJmZ9k2h3q6tdUYQS PLtWDjW3a6UneVCzmgS7jtWJNffgTdnBHCIeT3nzf3b0SpivW28RnnEELgQBSGwG0axA mhZ29PSK1NCZOd6BtsAMihed1hwu1cH81OHeu6gr449/e1aPsCbiWUzrmXx8Aj1vnkN3 e5Zw== 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=+54frm2BF9b0x4h3VLTQtdsqR6hdRnwcDLw7C242SeA=; fh=yA/ZzTR4GKgsZ5MlVb+VfscNDPdhmJZisz1UZ2ETSRg=; b=sx0vlhkWINLQBFRhvNQOSEIfyNHKHyICiX91s7JAaI6yCGyPo1JDtEyR/06FNbdCzK n7FlHV3MEERfcdoELLWO5amHB6k/AS3FD3ACl7VB80xcZMIwzUGOONZp3NoISk4B1Hc/ R56EIhpjwBaz3sIMiy6JvPI5k3gePKZcVliL2CI3+l0rAXB+2Gol3zI+LoZeC0iZSpd7 zsJxog0kudPrsfpTCmbxPVlHSTSVhczZhYEs35z/gDCuF0Aq/psoQv0wLPHrYs+gCemd 09xCdP3ws4QNRmxG1DilmPC2YfmXxAWdDVQcH0Gezo5HFYSzKxJF/bo0HHrz9nuKuVlA rhPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=FGGVTLYw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mj7-20020a170906af8700b0099327746bd7si8162879ejb.520.2023.07.25.20.58.56; Tue, 25 Jul 2023 20:59:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=FGGVTLYw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230270AbjGZDSx (ORCPT + 99 others); Tue, 25 Jul 2023 23:18:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229489AbjGZDSw (ORCPT ); Tue, 25 Jul 2023 23:18:52 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5651C121 for ; Tue, 25 Jul 2023 20:18:51 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1bba04b9df3so22917475ad.0 for ; Tue, 25 Jul 2023 20:18:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1690341531; x=1690946331; 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=+54frm2BF9b0x4h3VLTQtdsqR6hdRnwcDLw7C242SeA=; b=FGGVTLYwPeR+WMnjwMI4toEthyhRuGbvyo0laNbwGyrJG0Rpc76WpioCPzaTOgNkjp oBPVZE33eucPSlzkjVJSs/g06TVbmFgkVHZ+4PeLrOsjBfcdVDgjJsYrHrCIdd0iunPR gNSyLeJ2KuvmbCAQDbUxpamCavfrGexiS+w3Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690341531; x=1690946331; 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=+54frm2BF9b0x4h3VLTQtdsqR6hdRnwcDLw7C242SeA=; b=iNz+ka9X5FDJaq/lwvd9W7gd3GmaQj8nBlCXOXwp+tILiJKIjvVKb5TCigRxkYkfZP gzfUPMHwKKMJueUeiA/BJCeRZ4JxDoEKqyA/tnLOJAm2wY2xvtvyUR4DA4aC3S7Rhbw3 fbxo3TA3LEdS4Jcl9RnIqVQmtL9i6sAgGn+T2DhtnOuoNgZ6a3XByFd869fwnKuq8IEx ieKF2ptbhHT8+UE8Hd0VhDLhdo8sqLkWszmKcxzIHUewGL7Q0puZTYA2BYdLwdSqgip7 hkkqTf4cDLXQFlokfazT/oARz7JVuHT31vH5AdkqGFwXw0FB3AWlvKyhhIceazhcwwsM ygSQ== X-Gm-Message-State: ABy/qLbCI4eyH3RnInAkTXAW7kqwtazsQ5QBmnUVLsx6/mXJkdhewtex o0cohYqCsDDPrcxp1pUvRK03oA== X-Received: by 2002:a17:902:e744:b0:1b8:3e15:40e8 with SMTP id p4-20020a170902e74400b001b83e1540e8mr919513plf.56.1690341530878; Tue, 25 Jul 2023 20:18:50 -0700 (PDT) Received: from google.com ([2401:fa00:8f:203:a2a4:d590:6375:66ba]) by smtp.gmail.com with ESMTPSA id p21-20020a170902ead500b001b8af7f632asm4039466pld.176.2023.07.25.20.18.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jul 2023 20:18:50 -0700 (PDT) Date: Wed, 26 Jul 2023 12:18:46 +0900 From: Sergey Senozhatsky To: Andrew Yang Cc: Minchan Kim , Sergey Senozhatsky , Andrew Morton , Matthias Brugger , AngeloGioacchino Del Regno , Sebastian Andrzej Siewior , wsd_upstream@mediatek.com, casper.li@mediatek.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH] zsmalloc: Fix races between modifications of fullness and isolated Message-ID: <20230726031846.GJ955071@google.com> References: <20230721063705.11455-1-andrew.yang@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230721063705.11455-1-andrew.yang@mediatek.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FSL_HELO_FAKE, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (23/07/21 14:37), Andrew Yang wrote: > > Since fullness and isolated share the same unsigned int, > modifications of them should be protected by the same lock. > > Signed-off-by: Andrew Yang > Fixes: c4549b871102 ("zsmalloc: remove zspage isolation for migration") Have you observed issues in real life? That commit is more than a year and a half old, so I wonder. > @@ -1858,8 +1860,8 @@ static int zs_page_migrate(struct page *newpage, struct page *page, > * Since we complete the data copy and set up new zspage structure, > * it's okay to release the pool's lock. > */ This comment should be moved too, because this is not where we unlock the pool anymore. > - spin_unlock(&pool->lock); > dec_zspage_isolation(zspage); > + spin_unlock(&pool->lock); > migrate_write_unlock(zspage);