From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=192.198.163.4 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796394287; b=HY0eOse69xlXCCIt29SkuPoPk15Wb2gUmg0b7QJ9viHwvPbTtStgtK9GLTjyMeGb116f faySCGlyQiSJ5JMAfNNlUi3F77V40fiEuPOemUQRRyvrDXSfT8THapKbExDtQVGi07j1C 8kcmu89tc9yiOP+3xwq19j7kuIhn9q/bZQCQme1rwdxvDqACu+jXhZ0z2ShHlepKavYnz 41uVeVxzm1Qg8vJwQILxifmlA0yWaVK2W/8aJPLlzsEaM4BetW9HQ+KyFLNSC8Tk+IuoX R4cXnT3pmAjBAFjes8F3GrNm4EK9jHVvcvOj8+lb3dBLDvGWqAcVdBws0JSH5g1TtHA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796394287; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:Organization; bh=3xHVGlssRFbqIfxPzdW80lv8vUthbLPrQP4ewR+CA0k=; b=osa5C7HKQAklaTZGXN9Tke195FtTT/8z30Bl6HLA/seXXEpASy7zXd+Po/MBovgYAgZF ZvMylXGRVKPotl/W5Igyo2YjpXDPBKedePyyPG7I+rW4t5jpioCtPXu1obpOPQJFR4fOn oXirmGxXftMS4cFH742Gs31IfrQiJw9r8kB1b07PukhRLb4sISD61Ze7AGkKPAIGAbkYG 8v4GyvQ7ITshxcchcV8sDbf79cvl8K4dnfK3aHvCyTHuR9ZtMR5h1hW0XMgQR3Vw0gDrD a1+/kfI29Wdx8Dm3sGzFu9gXelfLSP8AYPRHKMe+0KEQq/7x29Du1Jgr0dbAjyrXgbA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=UBsxACv5; arc=none smtp.remote-ip=192.198.163.4 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.4]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 767ED606A32C for ; Fri, 4 Dec 2026 14:24:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 767ED606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=UBsxACv5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796394287; x=1827930287; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=+64EeNmW63Q5YatPNatsB0J9S0WI/5NfbD3Fzk7mrA8=; b=UBsxACv5XpvV/5ot3n58+uq6WpVY7zzUnn0ma2ODb1EQ26guDreVe6aI woOXc9pcH2CQqD/sb7bi3epRYUKcmlGjt0EgiTcFNKKtZICbfDHJKhqte Dmnh3IAaxs4WE3hiD1g96MWArhpUZ7vUi7Iifo7/OEKGJOxMkl/2fLQWQ uJ/PAqrfF2uLqz2VNVzNw2T+ey6FLD7Zs2enHbjVI0J70bSxNtA9cus1k Q/8Z3Vlh79Z0Wv/aycy+Ydj29PRr7jG7XtDNtN9ZzwWLrfft4hnif5Y7b YtTNiGrx7GT2rSlcoEjwjnkn2EBfo32McWo+d02LSi+Oxs+mHYjnUwDkH w==; X-CSE-ConnectionGUID: Wzgx3pQMQC+PtaTfAEyGvQ== X-CSE-MsgGUID: 8txORpjZQZeBnhmFw/P4ig== X-IronPort-AV: E=McAfee;i="6800,10657,11986"; a="131045" X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="131045" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa114.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 06:24:45 -0800 X-CSE-ConnectionGUID: BYuwJ4b5SO+fA0iEVW6cLQ== X-CSE-MsgGUID: mAGARILnSoGtWGH2v8yUQA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="14255311" Received: from alekseim-mobl.ger.corp.intel.com (HELO localhost) ([10.245.245.10]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 06:24:43 -0800 Date: Fri, 4 Dec 2026 16:24:41 +0200 From: Andy Shevchenko To: Johan Hovold 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: Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo On Fri, Dec 04, 2026 at 01:50:56PM +0100, Johan Hovold wrote: > On Fri, Dec 04, 2026 at 01:18:06PM +0200, Andy Shevchenko wrote: > > On Fri, Dec 04, 2026 at 01:09:07PM +0200, Andy Shevchenko wrote: > > > On Fri, Dec 04, 2026 at 10:28:46AM +0100, Johan Hovold wrote: > > > > On Fri, Dec 04, 2026 at 11:13:28AM +0200, Andy Shevchenko wrote: ... > > > > > 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(). > > > > > > Do we have a test case for that? Because as I read the __do_krealloc() > > > I see that *sometimes* (if some conditions happen)it might allocate a new > > > buffer with a smaller size. kasan_krealloc() in all three cases returns > > > the same address back without any reallocation done. > > > > > > Where am I wrong? > > > > So, for krealloc() required alignment is hard coded to 1, so the only way to > > shrink is to use __GFP_THISNODE, but node is also hardcoded to NUMA_NO_NODE, > > so no, there is no way to shrink memory with krealloc(). > > > > Please, correct me, if I'm wrong. > > You're right about reallocation, but it seems devm_krealloc() do fail to > honour __GFP_ZERO when shrinking. It might be true. Bart, who is the author of devm variant, if I'm not mistaken, is already in the Cc list to comment. -- With Best Regards, Andy Shevchenko