From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 D630746F497; Thu, 10 Sep 2026 11:00:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789038018; cv=none; b=D9pEO5h1VdAHoCuuYd886pwIlzPkj0M5ECmHPkdLSqZYfhHibE4J15MZqFEdK4dkSVz+pSUD985z44wvIKOPu0ejni6xjNRAJfkN/x/KvuelvkTtHCLdW9Qo8OIMRZ9EL1mog/Veh82uBVBHQrHQqTK8lntqWCVh2rkKl+9l1QI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789038018; c=relaxed/simple; bh=tnPqOGWy+G/exKowrqrFWAt1LzC422b7ugtuCq4Q7iQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bjrxclIyi+hZpg0kTeQ8YV4oU+LkffGApMmABfBKa1hQBux3glVCMAwKo5ymMYaDUG1SP/0xH92yau6CCnp8xvD8Zo/aODpAJo8n270YaohDMJDh5keL2JfZ1xKRtfaKzl4MSrMSdvoX9JiJ9ol0BRtgcHLR0pu7NfHwXL3cFOs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ACpqjS/n; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ACpqjS/n" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AEDB61F000FF; Thu, 10 Sep 2026 11:00:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1789038016; bh=BvSsEcfuxj9lC5YTGUuAUBtK1T4naFDW4wq12j/K7Zg=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=ACpqjS/n8i5Rs0K/trhMuPDITZaEeJ/fcxuD+p9zdAxP4W31/1XfwhlzCkzXJHkGG gzO0oUz75n7IE+L9bMVIrHzXtaBHmckwqlWsdZEWxsgMVvLTEWTuWdwxjEbXcPPS2t TtbO1dScBxocTHTkOfGoo5xfBf75f9UUT4/myO+Fcq1ZvssPeEoSr/XYDnHb954LTf +/MTUN+XqKUIFzLgV7PazYA4RtDklB2APxgfddYW2dtoiYUiVu8+sI+ZRy2ktSHEE3 FXkuwFw5LkR8z0RpvHIMVKHBUfaHtbQFnjvtjmiqslNylxMe4oDnWLEDKHb5bMzSLK oGWFhyhBT3hAQ== From: "Mike Rapoport (Microsoft)" Date: Thu, 10 Sep 2026 14:00:04 +0300 Subject: [PATCH v2 02/13] s390/chsc: Use kzalloc() for the SEI work area 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="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260910-s390-cio-ready-v2-2-e931086fdde1@kernel.org> References: <20260910-s390-cio-ready-v2-0-e931086fdde1@kernel.org> In-Reply-To: <20260910-s390-cio-ready-v2-0-e931086fdde1@kernel.org> To: Heiko Carstens , Vasily Gorbik , Alexander Gordeev Cc: Christian Borntraeger , Mike Rapoport , Peter Oberparleiter , Sven Schnelle , Vineeth Vijayan , Vlastimil Babka , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org X-Mailer: b4 0.17-dev chsc_init() allocates the work area for store event information data. This memory can be allocated with kmalloc() as there's nothing special about it to go directly to the page allocator. kmalloc() provides a better API that does not require ugly casts and kfree() does not need to know the size of the freed object. Performance difference between kmalloc() and __get_free_pages() is not measurable as both allocators take an object/page from a per-CPU list for fast path allocations. For the slow path the performance is anyway determined by the amount of reclaim involved rather than by what allocator is used. Replace use of get_zeroed_page() with kzalloc() and free_page() with kfree(). Link: https://lore.kernel.org/all/635405e4-9423-4a25-a6e7-e03c8ea0bcbe@redhat.com Assisted-by: copilot:claude-opus Signed-off-by: Mike Rapoport (Microsoft) --- drivers/s390/cio/chsc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c index 60a4a7e6086ce..c3186c0a372b4 100644 --- a/drivers/s390/cio/chsc.c +++ b/drivers/s390/cio/chsc.c @@ -1142,7 +1142,7 @@ int __init chsc_init(void) { int ret; - sei_page = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA); + sei_page = kzalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA); chsc_page = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA); if (!sei_page || !chsc_page) { ret = -ENOMEM; @@ -1154,7 +1154,7 @@ int __init chsc_init(void) return ret; out_err: free_page((unsigned long)chsc_page); - free_page((unsigned long)sei_page); + kfree(sei_page); return ret; } @@ -1162,7 +1162,7 @@ void __init chsc_init_cleanup(void) { crw_unregister_handler(CRW_RSC_CSS); free_page((unsigned long)chsc_page); - free_page((unsigned long)sei_page); + kfree(sei_page); } int __chsc_enable_facility(struct chsc_sda_area *sda_area, int operation_code) -- 2.53.0