From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 854E128DB46 for ; Thu, 9 Jul 2026 13:26:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783603600; cv=none; b=RZNEAdUSC2BnDG5e6qHZaASojS5/FJfS16phTAC+2XJ8XW+/q/DQpx5O1GWJuGp8lEYmbBBQdr65ilB7ENROdhvLdLzDPPpPIYtVOJdD79W9nRqUKGWrypXmIeNv17vjJxObSOllBsfeMtgdfI3A0qsEI2R/9qYIdjzl+Jc8IJE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783603600; c=relaxed/simple; bh=Zs/irjYjK3litAucTY9Kex/Xw0tTQqlwKd/rWtSGOuE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Y28tvXWIR3BXtaQxt98tNlPVoQZKptuFG5Nqny7zD0vMZ/MZISzx3ru9GoDqdURGXBukXiIY6J/MdnRHgN98aOKD6koYws1LfRdNNEO7D33nouau4s+pObzyUkJHK/zMoFJ0Zr01F+BvwZRtGDG+gjUZo+ZNl3lgZZjTjk+R1vM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=avpWVFFw; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=CC+2S7RO; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="avpWVFFw"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="CC+2S7RO" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1783603598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=umaix0cxC+rT6m1GnvXK/gqOVWmu6r2MZofHtjJ4yFY=; b=avpWVFFwRB/I9xErHMCSQnWyEwGcr8oCwjyQonyzW2uvGYF04Eni0ydGQlTrqlgAu3Mv0P FzH7lZ6+cVHvqPVNa9vuTes/8R5hO3D8I97OccKOpJXT5ZmfEcl+hkKGQnD47sJWuoEDgl i6GUQgNVsK7Uwu5smHTmDFhN73czFls= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-50-e4sHe3nBOjetx8NiLxtnSQ-1; Thu, 09 Jul 2026 09:26:35 -0400 X-MC-Unique: e4sHe3nBOjetx8NiLxtnSQ-1 X-Mimecast-MFC-AGG-ID: e4sHe3nBOjetx8NiLxtnSQ_1783603594 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-c15cec1ccb6so61158166b.1 for ; Thu, 09 Jul 2026 06:26:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1783603594; x=1784208394; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=umaix0cxC+rT6m1GnvXK/gqOVWmu6r2MZofHtjJ4yFY=; b=CC+2S7ROrEi/J5ID3hOd29uKioyVbBrYLDL0naZaiUMijCrGw+E6u0d2OshDXnFVwA j2JjroU0wPteLHvAkwqMJxmJc0Pk8SeOFNhoybSdz8KiCen9eDQsvWyOF1GANsuylxCG 38An/FRfdqW8419aR6b4STO0jqjkQmt3M4dKeH7z1YFFfPDFSeRKXTJz0UY2kWQ1ee41 yusRGbLnEG2zwxsh09hdxc+PS+OrqX7TUuGbRfDH4f5FVTOzQenIG4F80SI0seEmrjz0 LpdtXgdfE95d3nysYDYrHndAW8NW0qp317h8Leu8hEy405l1i7Mdt7yr3SuT5pzLm4Yp ssdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783603594; x=1784208394; h=in-reply-to:content-disposition:content-type: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 :content-type; bh=umaix0cxC+rT6m1GnvXK/gqOVWmu6r2MZofHtjJ4yFY=; b=KRDqtP8gxP9ZSXrfyGPRajJJKSOsal2cXddNjFqy6ieXw6AkCMyrxGWMI1KbIqyK3y jxOOA+eNuh+S7rImn3SbTr7WrZOYwHFlC4UHJIDQFvo23mS7PCBdprdq4ER+mGYf7RCa vnQYM1vWdFhDu3JCTm9uZeIya7BS7y8L4gZR5KW6/skf+dAuA4TVy4jezvpJdLqIMYnL WdKg0ohKNLjlZ1B2FNQdfFKneQVYeTQ3p52EJ5pn5lvBW0XqhZgKK0iObQwrs2m1YIAh KhgTl/S371FCTCSFrgeBRpq8si6EXU4NRj6kUqJi8MqqhdSHiuWDackW4sEf2pjBi7id ynhQ== X-Forwarded-Encrypted: i=1; AHgh+RqMxRAPfZItPbybVxDIr8qWmLKs0XfvQ7e//w4BVOgLK3OGhbknVRn5t/TESUtFSMSMqwhB5ANUoxbhXW4=@vger.kernel.org X-Gm-Message-State: AOJu0YycGjB6YAV+1gJdP+i0Zi0emkZkWH4pr3353jWxyEkLhmneCg0I tNfRCHj4kE+Pq+s3siHwFNL6Yyqvsj/OKBIhilQEFxTgt86K60LKn6G3GKe/ft0f8erobH3Hyvz PlHHaLqf+hh3vOfV24pgUPJneXZhGmDfYf+c987nmaVfbDFS+R3nbgAcpIL7dcKraCg== X-Gm-Gg: AfdE7cnbtwQUlDfll2jJku2ZHibaMsj89P5VIxVvff/VT7F2+r3KBrcwcyJ1DCwTagM +Ze1aWDA5zMRXXViYXnDW7tZx8J54gZM6BzRZ95odv5D2RXMjvUu+1/+8ohuYH7ZHr/Kq0Pw26O O0ndjzfURrJuVjZNGyBA9mkiFoWknKWvLsCIRkj3oZzcwqB+ZfXNWVbOtMAzl3Bb4Qhpfc0aTdV gza2kcyr4yjiZjH9TpJ1q13//RYDzkPrbJwtSIOnxuBPj4bvW/mGxELIL9Lwsu3lFxzianbQ0Iy cyoKitLAI2UnRcGUZhbYOTLykEZwTzQPYx6OCbC/WEj+XgGl4JuhlC2EFC225nVjgZIFnK0CXaj JRoB/j7pudrIeNPhNEHomIVi+mXDaNiW4KJyp2NztynDZyb++gBEiAto= X-Received: by 2002:a17:907:3f15:b0:beb:8c28:254 with SMTP id a640c23a62f3a-c15cdc62f3emr427043566b.0.1783603593914; Thu, 09 Jul 2026 06:26:33 -0700 (PDT) X-Received: by 2002:a17:907:3f15:b0:beb:8c28:254 with SMTP id a640c23a62f3a-c15cdc62f3emr427041766b.0.1783603593387; Thu, 09 Jul 2026 06:26:33 -0700 (PDT) Received: from localhost (pool-100-17-17-231.bstnma.fios.verizon.net. [100.17.17.231]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c15d5739621sm232862166b.32.2026.07.09.06.26.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2026 06:26:32 -0700 (PDT) Date: Thu, 9 Jul 2026 09:26:31 -0400 From: Eric Chanudet To: Albert Esteve Cc: Tejun Heo , Johannes Weiner , Michal =?utf-8?Q?Koutn=C3=BD?= , Shuah Khan , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v5 1/4] cgroup: Add dmem_selftest module Message-ID: References: <20260706-kunit_cgroups-v5-0-6c42c8753468@redhat.com> <20260706-kunit_cgroups-v5-1-6c42c8753468@redhat.com> 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: <20260706-kunit_cgroups-v5-1-6c42c8753468@redhat.com> On Mon, Jul 06, 2026 at 02:06:40PM +0200, Albert Esteve wrote: > Currently, dmem charging is driver-driven through direct > calls to dmem_cgroup_try_charge(), so cgroup selftests > do not have a generic way to trigger charge and uncharge > paths from userspace. > > This limits any selftest coverage to configuration/readout > checks unless a specific driver exposing charge hooks is > present in the test environment. > > Add kernel/cgroup/dmem_selftest.c as a helper module > (CONFIG_DMEM_SELFTEST) that registers a synthetic dmem region > (dmem_selftest) and exposes debugfs control files: > /sys/kernel/debug/dmem_selftest/charge > /sys/kernel/debug/dmem_selftest/uncharge > > Writing a size to charge triggers dmem_cgroup_try_charge() for > the calling task's cgroup (the module calls kstrtou64()). > Writing to uncharge releases the outstanding charge via > dmem_cgroup_uncharge(). Only a single outstanding charge > is supported. > > This provides a deterministic, driver-independent mechanism > for exercising dmem accounting paths in selftests. > > Signed-off-by: Albert Esteve Reviewed-by: Eric Chanudet -- Eric Chanudet