Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1116438rdb; Fri, 1 Dec 2023 07:28:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IF8X0t00+ZaPOCGzy0YLJtBzKoFChp1Wm+Xiz6jl/x2NgvA9QAAx6x8naUPDdwBnC/MvLCa X-Received: by 2002:a17:90b:1644:b0:285:8a70:b557 with SMTP id il4-20020a17090b164400b002858a70b557mr25258276pjb.31.1701444529733; Fri, 01 Dec 2023 07:28:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701444529; cv=none; d=google.com; s=arc-20160816; b=Zgg3deaUwHv/oPlNjHaHUzNYxDVjqZkZRHpjq/SHOKxagksHWEPcGnU5fSwK38OgkI mPmWRuG7n+oVkGtZeE78FOCAe6ASlbtQYP8+wEG1ID1Z06Ve1F1KJPT01pjKAX2jXCbA 0i+P9hPvikGWW1Jxm1XceiHtQXHZ7VZ6lXIYGgMxa/Dzhc/S0BVva1JyF3g1KhUKzD98 psM9DKbnpCzadpZyX4io6Dd4FLm8j8KyGnp5E3A4uG/jHazMfpU1LP1cEsSXq7LoNmMe WejeI0y6SzRCICICOmBJU06EoWXCrhRmGrzJZ5Ba/mvUVRX1ErIDdChJbMZA5/h7YsX1 DfXg== 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=FTQGEo0Gq1nAGsQuhkH/fxmAkBokmUii6biJ9HXJbEc=; fh=ppAvQYL1BiuYhjUYotup3r5i7KH4ZPCqlTp3QjNxj2I=; b=rcGFFB5CO1PVSevU13uCm+V3gYN/11nHI3za90vMSNKWQp+lq9Xxpn7swaVqPpEM+J xE2pRPS3jwmYVTUl3wIkWJ8andtbFvFuRB4MLWabfG3Pi3Hr29th5tT8TkVXdHxYWcUW vK4PqClIooPVl07dSsljrhUT7Q69bYu5Hsrd6OzVKNUUxPmxpEzTlBBQtdwLSOPLXT/h w4wFfVT3bfbai4y1FOoUH+cxo28bPyK8CmMurexrXQ2qsDA+lblbEb7zkNPmkBRhJqYl LwWDnEfn3qTZmIuHzs16huA8auUofG2PQPP5hEJqSxXO7hN855QITJ6sli8o7sYRMoeJ 8E+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=WaFXCE2L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id pf12-20020a17090b1d8c00b0028589f571fbsi3730572pjb.148.2023.12.01.07.28.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 07:28:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=WaFXCE2L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 4B475809CCA5; Fri, 1 Dec 2023 07:28:46 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379376AbjLAP2Y (ORCPT + 99 others); Fri, 1 Dec 2023 10:28:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379403AbjLAP2W (ORCPT ); Fri, 1 Dec 2023 10:28:22 -0500 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62EE01A6 for ; Fri, 1 Dec 2023 07:28:28 -0800 (PST) Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-28647f4ebd9so1441363a91.3 for ; Fri, 01 Dec 2023 07:28:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1701444508; x=1702049308; 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=FTQGEo0Gq1nAGsQuhkH/fxmAkBokmUii6biJ9HXJbEc=; b=WaFXCE2LN8j4vCk/fzP4+F6EMxM0eIttL+9WHmAN0PIFs9yxzyHN1Hqg4rkrBHa+iW A/RW16uq4FZ2xaw5WW6p154GCLcUGTYU034FEkdbPf4cK3w1tjhkZ5e7h6WvL4JYFaVu Dr898dOkgfUODKq8+cMKrvTmPqP+ElJAb6kWg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701444508; x=1702049308; 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=FTQGEo0Gq1nAGsQuhkH/fxmAkBokmUii6biJ9HXJbEc=; b=GUMebzOFX8TNoY41+7QhwsPkwDHXv2ylLuCnAHVDqGQfLs9cWYNOAhAhjLy7YyGbzO 8DB6MaYCbeCwtdC9//y2Yl+EaXOuUeF7kk8O5+ZRcgREAs80MOv7fHrZ6zSR272Zx+k+ NadIonASM87JQSK+wK8sSWP4mF+Xbd3G0QpCFksMUKMEOnwTY7lOz3Jci80AT3xOaXRK kMmumy8ozxIRbl6vWtF1N5chyMUader9XQRwLRC/wRi3Pf7wXViWejGbp75phlQFzmou ojoL4nxkLsqWdlW18JFDKDmuE0h6j8l5rvr8w5yG4xTuCCyYZOGGJ0iNxyVuW79UHRxr X9rw== X-Gm-Message-State: AOJu0YzzDYzd8zJ2657GkSb2NIJMRzlI2CC/+k1rhFjsQjxOngei9o8y IItgMf3hBeNU3OwUIYxTCX+WnQ== X-Received: by 2002:a17:90b:1c07:b0:285:a179:7218 with SMTP id oc7-20020a17090b1c0700b00285a1797218mr22275548pjb.9.1701444507773; Fri, 01 Dec 2023 07:28:27 -0800 (PST) Received: from google.com (KD124209171220.ppp-bb.dion.ne.jp. [124.209.171.220]) by smtp.gmail.com with ESMTPSA id ck11-20020a17090afe0b00b0028593e9eaadsm1433594pjb.31.2023.12.01.07.28.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 07:28:27 -0800 (PST) Date: Sat, 2 Dec 2023 00:28:22 +0900 From: Sergey Senozhatsky To: Jens Axboe , Dongyun Liu Cc: minchan@kernel.org, senozhatsky@chromium.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, lincheng.yang@transsion.com, jiajun.ling@transsion.com, ldys2014@foxmail.com, Dongyun Liu Subject: Re: [PATCH] zram: Using GFP_ATOMIC instead of GFP_KERNEL to allocate bitmap memory in backing_dev_store Message-ID: <20231201152822.GA404241@google.com> References: <20231130152047.200169-1-dongyun.liu@transsion.com> <3af0752f-0534-43c4-913f-4d4df8c8501b@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=0.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FSL_HELO_FAKE,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 01 Dec 2023 07:28:46 -0800 (PST) On (23/12/01 07:19), Jens Axboe wrote: > >> IOW, you have a slew of GFP_KERNEL allocations in there, and you > >> probably just patched the largest one. But the core issue remains. > >> > >> The whole handling of backing_dev_store() looks pretty broken. > >> > > > > Indeed, this patch only solves the biggest problem and does not > > fundamentally solve it, because there are many processes for holding > > zram->init_lock before allocation memory in backing_dev_store that > > need to be fully modified, and I did not consider it thoroughly. > > Obviously, a larger and better patch is needed to eliminate this risk, > > but it is currently not necessary. > > You agree that it doesn't fix the issue, it just happens to fix the one > that you hit. And then you jump to the conclusion that this is all > that's needed to fix it. Ehm, confused? Yeah. zram is very sensitive to memory - zsmalloc pool needs physical pages (allocated on demand) to keep data written to zram. zram probably simply should not be used on systems under such heavy memory pressure. Throwing GPF_ATOMICs at zram isn't going to fix anything. Jens, you said that zram's backing device handling is broken. Got a minute to elaborate?