From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796376529; b=qZ9getFXM0ZuzMVKQh+fdTyFBeM0BZli+9OMd5HWtdl9feLwCBHNtoSoagprpVAwikel 67G1JV6Vk6+WIfC7xmnFSB1WDYqpPRZ1/Y1KkemE3+1BtnWfywhiRLNAhSoMdaihr9JEL VBHSu6AsYhhoZWInz/gEfJu3yKSO2QwCKT6RMBtRbEwtKoHrBlNtYcbQZpRdqoMhmHW2c lBdBo6qSryjA8dqo3OsAAu2Jzh2XwrJeR2IdNYMwDcvYTz/BU34Ji5e21WpubTNwQAalU ED3DaYwLc6soAoKdLOpPFeMpvVa2kAHShSvIl6eySLInhjUtMtykT8fHewQvHJgSPZw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796376529; h=Received:DKIM-Signature:Received:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=ey8rUkuz1/HiSdpsW4lf12PrbQb3gcpUuMzfs+ADv/g=; b=fvxHB1Ez1ywzcKYlxsZAbe0a2ce58C8z2i2DHK6qD2z0lfZstqM812tiEI/XmPHxZlc0 1r2ChrVMoeFrP5JJqktv1eAu0RVWKF04y6yf+BLbswxVwCeedZr24HDFTVZvhkFzw3Bib t6Agk+pWfPNyIA68LpbWoYBwfNsSZwLSJUg7CuzCW8KYla4yqWcD2GkZLaDNvTE0+7W2D scIooXPR+yax/QfWsSxEoyOFavxeRIqvtGwVEfgVO46Mk3vUv8s9cF5Nsm6ZwARyJeCYB 7zqRpvOk+ttCx4Mf00oy9RKtRBhVYejG7b9SbHIxzENzq5LWpW40RVO4gL0jSsB5bVQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=F90DMxV1; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 079BE606A322; Fri, 4 Dec 2026 09:28:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=F90DMxV1 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A9B81F000C2; Fri, 4 Dec 2026 09:28:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796376528; bh=ey8rUkuz1/HiSdpsW4lf12PrbQb3gcpUuMzfs+ADv/g=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=F90DMxV1XlccvVOd7OMjQN5V/scgcVXFONrQ+n0YicLsQMAM/up0AepY57PWknrn+ BrVMqxwDPZOhtJCM6bJQgYXtMuG13VOoyK9dnI1PevmzCtyiEGj5VjbjzmRSQgzWwx cC5ePk+IFC9MhfFHBciKDuDf2Hcub5p0+/RRWwMZ0K/WYgLSMsF3ui9DK4HPwAXo9U DcOAEBj/DiRz4GkzFxfjI39sziVUEDRhg3sFzAcXD5ph3jD7idfTc41+TiOtEXZpdW KQ8B35+BhxqsVVmzcSW/WFWKmAwbslaYrgLwuvnvU0mOVrqeJng24rQ4YYMtY244tX LpO2PM2Hlh26Q== Received: from johan by xi.lan with local (Exim 4.100.2) (envelope-from ) id 1xZPaw-000000062Re-0Cq0; Fri, 04 Dec 2026 10:28:46 +0100 Date: Fri, 4 Dec 2026 10:28:46 +0100 From: Johan Hovold To: Andy Shevchenko Cc: Eric Yun Lin Chiang , Greg Kroah-Hartman , "Rafael J . Wysocki" , Danilo Krummrich , Bartosz Golaszewski , driver-core@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] devres: update node debug info on in-place devm_krealloc() Message-ID: References: <20261203005704.3066960-1-ericyunlinchiang@gmail.com> <20261204003919.2280818-1-ericyunlinchiang@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Dec 04, 2026 at 11:13:28AM +0200, Andy Shevchenko wrote: > On Fri, Dec 04, 2026 at 08:39:19AM +0800, Eric Yun Lin Chiang wrote: > > On Thu, Dec 03, 2026 at 01:42:35PM +0200, Andy Shevchenko wrote: > > > Do we really support shrinking for realloc() in kernel? > > > I am under the impression that we don't, so in such a case info should > > > not be updated. Please, check this and confirm. > > > > devm_krealloc() accepts a smaller size and returns the same pointer, > > like krealloc() does, but no memory is given back. My changelog said > > "shrunk", which made it sound otherwise. > > > > The patch only changes the size recorded in the node's debug info, so > > on its own it only changes debug output, which is not much of a reason. > > I wrote it as groundwork for letting KASAN check devres allocations > > against the requested size rather than the rounded-up bucket, and I > > should not have sent it without that context. Please consider this one > > withdrawn. I will come back with the KASAN part as one RFC series, > > together with a concrete case it catches. > > Doesn't matter. We should not lie to the users of the traces. If size was not > shrunk, it is not changed based on what the caller of krealloc() asked for. > If you want to add that to the trace, it should be an additional field or > so, not the lie. OTOH you can introduce memory shrinking support to krealloc() > but I have no idea what will be a perception of any of these approaches. I believe krealloc() can shrink, unlike devm_krealloc(). Johan