Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2348811rdd; Fri, 12 Jan 2024 07:01:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IEF5Q82xTi+hwc4JS/0hqU9A1no7kB8WD3FVrK8xZty6py9w9MuaS6HiTh2hcUBpp7PWYtb X-Received: by 2002:a05:6214:e61:b0:680:c616:7a22 with SMTP id jz1-20020a0562140e6100b00680c6167a22mr1163881qvb.121.1705071687517; Fri, 12 Jan 2024 07:01:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705071687; cv=none; d=google.com; s=arc-20160816; b=M1YQr8qrUdNrv6QhWAcIz4l9mj+ljN25ZT6YTZXHGLdkkWiWNCqdOaf/ehrF/n5ka1 p5pE6/hmDj+68i8yXZV+k7mCK+XIryUL4oyzoVQeRamUamOMiTyDxEwsqytquNGNLgyI rG2G3X43v/9s9Sw+tTOZckn2BRgRSC9gXUsUSWnNCwRqfUHtltWpFR3tGT6jkFz7G6G2 nR1Rq6Ry2rlnyKSacp4iljaTAKWNM/zKLypznag8xgKX7pT7lPojv9DiSYtsETX9c4QU JxYQF98QpN/BuAkLQSBX6lP/Q4xA5thtgZvmHTyyqs/9jv3teXeo9YP+4bVCDmVosqLZ BsIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=mZfbtSP2eLg7KULWpeXHehpSY+IdUn5/j3kjnvUcs2I=; fh=Vp6NqT+eOT3ddrIxLAubQjykJ39v+pHxhW18YfjtUas=; b=WlugauKZxhY+fnKo3UgcICKiKhPD8damDG8nwjsoGNGjfAUyKoiOE+bBLh8TwM1Uy/ WwHTiJPDrztcTT9QBcB0kAKBJ14jZEctFjQlCKUkFk7jET/zqd20FLLrhQOUCf+/SuLG sQY15oQYxB9W3aX3mGo62k8bjm9YrQgjqGuZUhZL9D454cKmUUVBAVfbbqPJ1sD7xP1Z iAZpGYozv/KF0f+mYVfBC7CkV0aqr2k9yZP4gAWU/p3Flae8cAGw3gnxVwoOe0d5LeUa +UdC67sqcNLGWkDvlVYgN85ctjN5jisQ6UT4DV6x7YTmFWo2BE3UeD1IY5fljK2B8bjD rRSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=ocbJzJk3; spf=pass (google.com: domain of linux-kernel+bounces-24779-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24779-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id s1-20020a0c8d41000000b0067fae1fc6a5si2931931qvb.245.2024.01.12.07.01.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 07:01:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24779-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=ocbJzJk3; spf=pass (google.com: domain of linux-kernel+bounces-24779-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24779-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D4C871C21408 for ; Fri, 12 Jan 2024 15:00:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A7A036E2D1; Fri, 12 Jan 2024 15:00:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="ocbJzJk3" Received: from mout.web.de (mout.web.de [212.227.15.3]) (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 9ACCE6DD09; Fri, 12 Jan 2024 15:00:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1705071632; x=1705676432; i=markus.elfring@web.de; bh=mZfbtSP2eLg7KULWpeXHehpSY+IdUn5/j3kjnvUcs2I=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From: In-Reply-To; b=ocbJzJk3E7Vjj0p1kohA3nFwk/dy8MbzNeqmc5vT8VkFWdJGEJa5IQXTJk6e2l5a PWXo8n7ApYh9dgzwcK6XAu4VXSbXjt55zJbXkIZHudLUM1meXRGdRN5pkZlO2072O /5UQ5uykB0Q8ApIKL9L9H1YWNBlAj44lR9tuZ+oYS0X6LeBQMH7z75+Lx1Dfw+Stm ur3acoNoyc3bQGi1XOBCOE9Qbe3bksHoX9sTrRQGXMzy93WQyHwMpFfYz/bYIp5R6 Uepa2vyPvbJT46e1lxpHjlKZ7VdmIcKl9VUVA5MPW1UXkIWOqFsLfLhJ4uXdI+vVP p+qH3iFmSGoHCKr4ZQ== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.91.95]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1N7gXO-1r2wjF43rm-01558N; Fri, 12 Jan 2024 16:00:32 +0100 Message-ID: <96e1e30a-ae2f-4dfb-9a1c-edaf6b8e1231@web.de> Date: Fri, 12 Jan 2024 16:00:21 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [v2 2/2] io_uring: Improve exception handling in io_ring_ctx_alloc() To: Gabriel Krisman Bertazi , Jens Axboe , Pavel Begunkov , io-uring@vger.kernel.org, kernel-janitors@vger.kernel.org Cc: LKML References: <6cbcf640-55e5-2f11-4a09-716fe681c0d2@web.de> <878r4xnn52.fsf@mailhost.krisman.be> <49ecda98-770d-455e-acd7-12d810280fdd@web.de> <87frz2k4jm.fsf@mailhost.krisman.be> Content-Language: en-GB From: Markus Elfring In-Reply-To: <87frz2k4jm.fsf@mailhost.krisman.be> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:3fcZXN079uvfIcjs2xVAhdFEtF5OObN5kLwIPmxpQDsZhhkZULL NZ7w4yaCeziYpmKoLQui1CfJKn80IgEQMLQg861wIvzSC7Nb5ZxgYkMYvR6P0D8y9AYyfAB kGOfFcJUP/YIIJtJS41hkuL0XRporYyhOx6l8KXpcEYxkoCy/hixa0pqdeNBJeZr4xpl5sV pQWGmRAd61sq1upCB9ArQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:CX07fjvmKG8=;djUVypSqjkR9zW5MJaSHacMcJBr hzFLPkxRRXiuFx0Jo4+UmKQ59SuzUOobiT8AqAiyEQ9kigZaA9Mb7c1AfdenkzU/Z4KDutFQr xPhZ1PUYg2BbFsm6Oz5Ebx8b4CWy+2w2ltSaZYVujiap0WFNQA7LkF/CeGU8+Yqvbri5whvau 4HrACfbd5ynnK0kXbfgQMwIPLdO4yQo2vOHvAlHtmNeN1thRI8EBVFVHaWDlrA4XEWEZwrbdq iTN/PbvVVG5m7la4MatvMjfNS2hJAtl+h3xxX4qgzZxq9zUYLcZPvw5DICEo1CXA8xaAKNDKj yHu86QsdJFMBChktzct3RaZ2o5o0j0U3AdaicyuQQbjQR0ILF67qBT6LXvT20DqhBYmJtaJgo HkF0z/40yQ3pJSNR2Qx4KwIC65sOzuZtxbtfrvPpuoFKeE3teQjgl3CskUzB8AfJspLD0C8dw j1KDydvXZVgSEGI333xrEogt+wUt5iG11BtPbgOwUUSjrj8M/7RAy1OsPAOId6adwi/bVt1B9 uHc98O42hIGLLFusWrmJZ7lvfFFSbaKFlrX4mtiCnb0zZbP41wQq9FGFBJnMCPK8WYE7rFM51 +6fvvQVuEfCgBxQ6Z4PA89OPBIWR/KMWLXvQ/yEEXY7csaR913ASvA3x2YB2MT1xMlPt05M44 Mo2K2NkuUfiPSK07ecKcVf3FoptwHVUzc5lib4WK7q3O+kL+QAy2Fnk23rvp7wsLrzBbbhjHL KS66N+JCKoZERCAPNx+jELvkYthb7wk37HufF3CqlvhDuYK7wGCDV6TgMEhuoc2uLiyMSPkIR CdWw4UDY+SuAc8lF8GPLKJygTvqDPtV1GfhPY4eMf719J/HzMyMlimhoeOP8BcpP03V3EkY2N MGs6OHuy21uj0sN4SuWIBcRUYGFQy6DrTlHBCpSXZOTY6fvoxkyf3uKUzWL8BvY8rnZNOyK4W bqBhTQ== >> The label =E2=80=9Cerr=E2=80=9D was used to jump to a kfree() call desp= ite of >> the detail in the implementation of the function =E2=80=9Cio_ring_ctx_a= lloc=E2=80=9D >> that it was determined already that a corresponding variable contained >> a null pointer because of a failed memory allocation. >> >> 1. Thus use more appropriate labels instead. >> >> 2. Reorder jump targets at the end. >> > > As I mentioned on v1, this doesn't do us any good, I dare to present other development views. > as kfree can handle NULL pointers just fine, Yes, this is the case. Would you dare to categorise such a special function calls as redundant? May it be skipped in more cases? > and changes like this becomes churn later when backporting or modifying = the code. There are usual opportunities to consider for further collateral evolution= . Regards, Markus