Received: by 2002:ab2:687:0:b0:1f4:6588:b3a7 with SMTP id s7csp133481lqe; Tue, 9 Apr 2024 17:53:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXlwjWYJAwr5JrDjxXfffkN6pFffn87QJ53xiAJrwyQMefomTLzI+FvGjh7IcGcm6+qQnNbNVqvi+8rS5CpfZIpVuyhZCUDm1Tza2FoKA== X-Google-Smtp-Source: AGHT+IHRIOSOk5jIK3oPnBs23zcrzO1Op6zz+mECT4LETsXFkc9piGTaMI60PV7+BCkut0TIeyzf X-Received: by 2002:a05:6358:79c:b0:17e:d8fe:be45 with SMTP id n28-20020a056358079c00b0017ed8febe45mr1750303rwj.8.1712710426059; Tue, 09 Apr 2024 17:53:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712710426; cv=pass; d=google.com; s=arc-20160816; b=V6vIV2JDsVgoZMU1tKdUiCLuxOPP7Hn70kBan4rKfgR76bUYu3RIx9Snpld7CYfSDw OICqR2RDXcL8QtO4UvFGAFyWBWcA9Sw9IQuqAITyUolX3BJT1vu9kxqW/jmt6tjN0v1z 0qsZ2yWX2IqE3T80Vch3FPajkfme5tdoXO0uLVHTP//aO3vy1x93cICWS6Cn6SsWCo8a 0LfLoRcnWzvT2k5p2OaxJ/HiL+iWekqp6E/gNnIjeCqWKUBVPsWRJQ+MTHF4K6/6T+yB aMDhyc5Qg5omq/JTUa5doCJSQLpVhp+IAitEbOi6RfSsqvWnqPlLEa7MrSk+ECyEORFU +1iQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=4w30RNt2IfMUjklfvgDmalvXrZsyb0372fw4oVHKjSk=; fh=3Z2NkmIbYDLQ0mATFNXk/zoOqOckRv6vpLyon7jpZL4=; b=KsNGiFXY7frjZ9GdkFCqZIakzKybSHxtzcVWWBUAEIJM0TpE9r6uUHulLhcKH8Vamf GLnZ3XcqyXiHAfCIVoqwrr6m5y4MgWFHjgcj5uPa+5vLf7UWdB8IygDwzuOG46oxYv5z 0oomFvFnPE/JYQwLCZuNbMJGOY7fHbTIy4plIQxH2P/XcMV21Xq/C99T6UONsUx2FEAZ DAONJzXRhYAnXUuBBEb/oGehsGr4pT2/Cav9OJrMlIZtVIM2drT+nV1MSvSb6Ua1VFDu nlpfFqUhXNvuUvviDTGRxYDBU/gLn4Ix4ru5kP9GZKPNQmeEN1sb8Z+MA23cXoT5kmH8 /XNw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=IYBprYRw; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-137781-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137781-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id c197-20020a6335ce000000b005f401ccf2fesi7389422pga.600.2024.04.09.17.53.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 17:53:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-137781-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=IYBprYRw; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-137781-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137781-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 A97F1283FFF for ; Wed, 10 Apr 2024 00:53:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8687C4A11; Wed, 10 Apr 2024 00:53:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="IYBprYRw" Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (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 32CEA1FAA for ; Wed, 10 Apr 2024 00:53:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712710420; cv=none; b=NIZ87J9cSOIoUEjYF1SR5WbKPeU+NschHq9bca+na0hyNpBNsjZlc1dJZL0+vHfDMP4cRbdcpip3h3R3JGi/b/y0CoJjwYu64q00QGBWnfS/bPsct/sF8HLeEHnRKy6bHNS4RKdApUj6l+vY+A3z6L2t1sPK1/pGv2kzJlahPlM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712710420; c=relaxed/simple; bh=4w30RNt2IfMUjklfvgDmalvXrZsyb0372fw4oVHKjSk=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Vhl3+TfAbLPJ9lbkhr1N1gWj57i0ez0VZFV6yQ8PV2MQKLXlPeUIhgAnkLxdh3B3BxneKdnDEcb8aAyPxZY1WepJRLIO0TRZDXmbai8vrmByLb7MIddqY0TjWkJ83jEKjeOjnR2mbWNH+USBjT5jbBOPzbhUtKg3irqMH3M3mLE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=IYBprYRw; arc=none smtp.client-ip=209.85.208.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-56e1baf0380so7040494a12.3 for ; Tue, 09 Apr 2024 17:53:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1712710417; x=1713315217; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=4w30RNt2IfMUjklfvgDmalvXrZsyb0372fw4oVHKjSk=; b=IYBprYRwZ58uQJrJSCREPRcLVsZF0co+3M6qpzyrmkKCseEEg2c+HDHBZ3Qp0h/2ZI uTMS3y0mFloQH3iI69uIUhVu8ohv5MyyYeXY70i7L2XDEcRRh1/J/9YRekPDEEDV5zvt 8lkpRCn4bDXb2ME8k4Er8sSE9ihuNl7v0QpHZD3iVwseCnWaSAsCXV6idloSGugDx39t Uc7D86uWboRJGxxaFatIWH8xIh20wq/hxjXHFiGaD/9ma18e/81ythckVijq9cJBqIXM PJ1icPaSa3QBgwZzvjhlO0aRmSGJuGj0RpSAE7uECfS5ZwN3VHfzUAnSSWcoA5DtM542 Iq0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712710417; x=1713315217; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4w30RNt2IfMUjklfvgDmalvXrZsyb0372fw4oVHKjSk=; b=uwNUVHKieUtxZierO3/AK25964GGD0GbBqzhIB2A65HWEwnCDQdU1ylrFaJPPrrI1r 9yh9bs1owYHIexf7eGdIuvtUwEMSoCRGHNqD7xYIeZMmlN4GXvpAn/q5xXxiJcOzZeLZ eklVTpmVXAnzkooRegcmIe8q6TtLCDjHzMtLK3ZjcO0kuvEu+avlyz5jTa/xYsUKF2to N8RsgVMdYAm+YcOTRxPS4LMA4xcVHPfFrpBfcdEOAheIslVIHThzL6SK0CSD6sBiI3n6 VvPrMnkodNeYF8u0iouZRfXTCsCixJwbLd3LOlbGoIRCVmisg22sMXsy6qqvBGCejzD3 Wfng== X-Forwarded-Encrypted: i=1; AJvYcCWBaRpCKCKQtoY5IpgH3TYOFGShEzXec0aPvTBOmvdSPJUVCS9GvTfcmt07P0Qx5aJhldzdVAyuRrRgxTHb9V9fSVjG2ObdJQWnp/7R X-Gm-Message-State: AOJu0YwJ/CmghuLVc7hYeSpjIz4SNnHwUnnWr2LZijMb13acDIlJr2o5 WzLxTkvZvh+Db6Nx9Pr7QBEXW25GY4Zk21jRzs9us3oZfHTQhLPI6htrWMLaGBltPMAB5APwKQz 92okhgn6lrczPJGNDbt+XmW/zmA5VKNaZQLBM X-Received: by 2002:a17:907:20ec:b0:a51:deec:483c with SMTP id rh12-20020a17090720ec00b00a51deec483cmr557352ejb.6.1712710417418; Tue, 09 Apr 2024 17:53:37 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240405053510.1948982-1-yosryahmed@google.com> <20240405053510.1948982-3-yosryahmed@google.com> <20240405152619.GA866431@cmpxchg.org> <7aec7b98-db81-4238-bdd6-afb69679f852@redhat.com> <69dcd33b-e8de-4927-93dd-d4ea22834a18@redhat.com> In-Reply-To: <69dcd33b-e8de-4927-93dd-d4ea22834a18@redhat.com> From: Yosry Ahmed Date: Tue, 9 Apr 2024 17:52:59 -0700 Message-ID: Subject: Re: [PATCH v2 2/5] mm: zswap: calculate limits only when updated To: David Hildenbrand Cc: Johannes Weiner , Andrew Morton , Nhat Pham , Chengming Zhou , linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" [..] > > Do we need a separate notifier chain for totalram_pages() updates? > > Good question. I actually might have the requirement to notify some arch > code (s390x) from virtio-mem when fake adding/removing memory, and > already wondered how to best wire that up. > > Maybe we can squeeze that into the existing notifier chain, but needs a > bit of thought. Do you mean by adding new actions (e.g. MEM_FAKE_ONLINE, MEM_FAKE_OFFLINE), or by reusing the existing actions (MEM_ONLINE, MEM_OFFLINE, etc). New actions mean minimal impact to existing notifiers, but it may make more sense to reuse MEM_ONLINE and MEM_OFFLINE to have generic actions that mean "memory increased" and "memory decreased". I suppose we can add new actions and then separately (and probably incrementally) audit existing notifiers to check if they want to handle the new actions as well. Another consideration is that apparently some ballooning drivers also register notifiers, so we need to make sure there is no possibility of deadlock/recursion.