From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (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 69DB632ED38 for ; Fri, 23 Jan 2026 00:34:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769128462; cv=none; b=CoHU2JxBwfGop0Zu/CybNqsZ6wUZxtYE1tsY5ZL1Kk51JCyfEir/szrb5X3skA9vvRZal/JzXx6GAlveUbzkzVJEKjxewZ2HafeahQAFws6XKROdBKvH9waEltVKSaMF3DTpP/F2S5OLG+lieu3TKiPRiPQ5qXXSgaMJyD0opzs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769128462; c=relaxed/simple; bh=ksTMqewe9wJeVkWUQ6teggTVZqK1udNl0Tl8ePWbE3E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oIn4HLS21OTFrtLZT0FfhMl/N4W+OzaQz86ll/QlxWMibblLniqJCiveQ3f6ICZO9ZtKoQxlHBmsRDSUMlWeGqWyKcF2LjVhuURCbwBAkJcvRgJCybRRfe/u3etV/6+Z1Cc7GJEL7SrBn85dACOz1gDpRO9D7s/qmnt/tmZjVGs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=LAD+KmXa; arc=none smtp.client-ip=209.85.222.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="LAD+KmXa" Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-8c6aaf3cd62so219357685a.3 for ; Thu, 22 Jan 2026 16:34:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1769128453; x=1769733253; 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=asBGl1upDPy9EBtcWnpVXAcR6hW540Iv+SjDFfHMW0w=; b=LAD+KmXaQh6rB+1Krguj+ggwo3qTVf3RXV4ObCa3YthtNpWRX8O98TaQkTCTMWCGOq iIaK+2nRWXO5NkyrzMcatolxCudZ1JyYf8pnSIB0e78AfLWVzweTAw00UPvGmBe3Ot7H b0q9OCpphZJdIKVWHsBDJsM2dIvezu5Qiko9UXaHoL0D/PRzbo+fiuO3fuqvnPcVdBXp jw1ELWV7Cc6twpT/PScO++dGDevJgSFfdqcxMpFP0/F0FMEANIRKcIohZOqAPPQZwf9Y oYKW9R/5k14HFppShwW04VtVA8tDjQ5lguY1KkleSJjcRfmE3p+fvsM947WQdDzMTfNk Ye/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769128453; x=1769733253; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=asBGl1upDPy9EBtcWnpVXAcR6hW540Iv+SjDFfHMW0w=; b=UN2tstNlUDVb6091+nHOxDdZw/9jrbQ1FIXyXXviyt7OIXvOWdk6VVAW3wY69FMjXe uVZatfY5hITFTwYC80RWdViLLuOBtgaY2tOVT2PcSkRoMvhhHuf8Nr1BuwIgP7EAXTcq IoY3N/5FDHLp9PNPqIB9Af358ndCjxfO6wYFIfsOIaquJMkXlanh2qJTDLKlhhjq0vt8 XKkYOmNMeEktBNOOfkKVZJodY5380J5/ASbP4u4N1mv+4bZAQhq/Ao7tJIWqcUwYRPGT iXaKK6QonkVk5jKwiBcn6rn0TkJxMu/HsC+ZM2Uf7GZLrB1slYysNbqceYQhGyVzbFvH Ag6Q== X-Forwarded-Encrypted: i=1; AJvYcCVJeftQ/QIWXqw31PPT6dxdoAbYI2gUF68ZZfID3IOoNVy7cyo7Pza2/MgRXiyQEG94WJ7HOd6B8BaVQuc=@vger.kernel.org X-Gm-Message-State: AOJu0YyTduGCb8VkTsg8yhLS5RZR7tsrQtlOfpRunezdiOHdqDIPD1ui BucyVvGrRH6yjwB2/pCJGPNKKgal9WS3ZdsRolZs/2S6lDGA7GjtNBJJstkBh/Upc/g= X-Gm-Gg: AZuq6aJMgGhCz6I9PsY2LDTHMQSn0hA+k6nNmrmucC+MEYzYp15jffzgs3WtOzDnuZF SlVAWe1AIw3a2ON+TFWI4/nKIOTWvYlO89Bi6FcjkEHoiuEwdkQCi8RVj4xf6jHt00u8aqaQQc1 vJdmdTRbb6p4W2lgLvZUbmiic0zhSpcuNvIZHmz05ss7EMkumYeTCX5Jhj0mgOVD5jDmSgat02l aOcrkOAKnIlHmjO6whqMVHGzxwaq386r0LoL5qhIfdPIuMH4kmfltRSd7giQ88w4hHG4N3KJrqn 0ezbKCR/CcNksTiIbYkzWsqHJJfJ7K2/zFUqOmc6/BlfACipwBzykY+pJEVfNPHqEBgy5V7rIpO dUTiGJGprkmchfMbgybpCuObu9t4hrcvIuLg1PFJCwCRBscWS8ngEW9KIVGcj7hJoRQQG37FGOh 16TXsw9NmMa1FegcZliq5Ik07dhDpLt7eautgupKYxhuoFgUO7O8e1zGEjaldStRSOdr7mVQ== X-Received: by 2002:a05:620a:29c7:b0:8a1:b5ab:bbd6 with SMTP id af79cd13be357-8c6e2e369f0mr170716185a.71.1769128453428; Thu, 22 Jan 2026 16:34:13 -0800 (PST) Received: from gourry-fedora-PF4VCD3F (pool-96-255-20-138.washdc.ftas.verizon.net. [96.255.20.138]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8c6e37c71f8sm54022985a.5.2026.01.22.16.34.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jan 2026 16:34:12 -0800 (PST) Date: Thu, 22 Jan 2026 19:34:10 -0500 From: Gregory Price To: "David Hildenbrand (Red Hat)" Cc: linux-mm@kvack.org, linux-cxl@vger.kernel.org, nvdimm@lists.linux.dev, linux-kernel@vger.kernel.org, virtualization@lists.linux.dev, kernel-team@meta.com, dan.j.williams@intel.com, vishal.l.verma@intel.com, dave.jiang@intel.com, mst@redhat.com, jasowang@redhat.com, xuanzhuo@linux.alibaba.com, eperezma@redhat.com, osalvador@suse.de, akpm@linux-foundation.org Subject: Re: [PATCH 3/8] mm/memory_hotplug: add APIs for explicit online type control Message-ID: References: <20260114085201.3222597-1-gourry@gourry.net> <20260114085201.3222597-4-gourry@gourry.net> <4520e7b0-8218-404d-8ede-e62d95c50825@kernel.org> 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: <4520e7b0-8218-404d-8ede-e62d95c50825@kernel.org> On Thu, Jan 22, 2026 at 11:41:24PM +0100, David Hildenbrand (Red Hat) wrote: > > Right, but I don't want any other OOT kernel module to be able to make use > of add_memory_driver_managed() to do arbitrary things, because we don't know > if it's really user space setting the policy for that memory then. > Ah, this was lost on me. > So either restrict add_memory_driver_managed() to kmem+virtio_mem > completely, or add another variant that will be kmem-only (or however that > dax/cxl module is called). unclear to me how to restrict a function to specific drivers, but i can add add_and_online_memory_driver_managed() trivially so no big issue. You'd be ok with with this? add_and_online_memory_driver_managed(..., online_type) { ... existing add_memory_driver_managed() code ... } add_memory_driver_managed(...) { add_and_online_memory_driver_managed(..., mhp_get_default_policy()); } ~Gregory