Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp35640105rwd; Mon, 10 Jul 2023 10:13:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlGVvP9biD1MRF/SIqjH9PJF9paZd4iRn/1BtShbpJZv3mPTylsz0a38pnwt5CCYNkEaHOM/ X-Received: by 2002:a05:6870:d193:b0:1b3:d10c:440d with SMTP id a19-20020a056870d19300b001b3d10c440dmr14007530oac.9.1689009214490; Mon, 10 Jul 2023 10:13:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689009214; cv=none; d=google.com; s=arc-20160816; b=uKFZt0bZ/MIlwkaoEmgZPEPX6xQgCOpo9tHwvU/YKy3uqhPHo/uEpN8nHXMSFIOSjD Y9iKpTobbzeWEpPpvGSS8QGBsu/mPUkOzck71qEkuMuYPzd9VKLiLVSXgOcH/eKzd7Hq lad/klnLJm+F63JtXBpBiHbT6TeSiCOAmERVr7V8Z4Odxo3lrZemswvBDzCioKYpZFSg ofHtCGK/51+q8+rxTuYVLeR/1MMYdO5DZuBUBrJizP+LCc0umMuoNA+AAU3/al+id6Rx XvIB3UdqqKtM/jdSY0L2CwuO6cVc+oLCIiW7D5RVfj+OXayA239tsHdw/vJYxUO+7rus yuIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=twIKQ2MHmWju5IY9XdGeqwYNLAm5VOVmCmH1cwAeJvk=; fh=fc9jaO2UQfuMXDWFlWlBYk6IOElzb3MkLfdQl3pTQHQ=; b=EP/ILtmts0Cj6dBqGFxTBOAU3tcC3/wZ9UIxm/oAl7gUg5CM3SLWqjqYCnc/qcBvcc X+FFZ5+wMHjWtng9dI2weEySzykvmeMC+ODsz3fhuVkEFu7mstfkc3a+LtX84VHsPFqq NY6T4PfyFTruSU8wQQVpx963JkRdp2Rd0Xp2ReyzmKc3Im0ghtZcp7vmqjsBA86V8Npa /G60E8tBwbz3rkx2ASTs/B8WATt8nA+1okQvWMYSij4RA5mL7MAt0lMZzcUnn7pTe7xs 3S2iSbRf83pYlFEKj68sYkJyx9jv3jZDsTOpuRsWwx/OGSBwDjolJ+rOOvyTdJjWIszp iGAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20221208.gappssmtp.com header.s=20221208 header.b=sprGqyuT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p2-20020a17090ac00200b0026384c02c03si169992pjt.140.2023.07.10.10.13.22; Mon, 10 Jul 2023 10:13:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20221208.gappssmtp.com header.s=20221208 header.b=sprGqyuT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229679AbjGJRC1 (ORCPT + 99 others); Mon, 10 Jul 2023 13:02:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230040AbjGJRCZ (ORCPT ); Mon, 10 Jul 2023 13:02:25 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB08ABB for ; Mon, 10 Jul 2023 10:02:23 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-682ae5d4184so1016627b3a.1 for ; Mon, 10 Jul 2023 10:02:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20221208.gappssmtp.com; s=20221208; t=1689008543; x=1691600543; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=twIKQ2MHmWju5IY9XdGeqwYNLAm5VOVmCmH1cwAeJvk=; b=sprGqyuTIkmhlp/iXd5gmNH66qzxiDBk8Cam7K03v2kzxqK9/AFYFQvGhIE1D4y/PY mgSHU0aplUx66upCzdNow5DVpTrfAY2q407OHNIoA+nTIyH3oMpGtxM8Cb3gIHwlGpWN l6v3kltpBon+nO1yEEILHeHPbORVFoQ6qJ2DwMiqvrNWHdwr3LAJtsr0xoTCAyloTuR7 5VekZ5DWDlNYCoXiZc6B3++nUd6Pxl4xfJFwEGeQX5hADWaGGbYzlUl5DSYc9B3CROP4 kxkNeIbm6TmTeZDMzQo4TSmhUXqz9V/lVHLrEpjVqIqdIvjfLg0XDCVu+4kkSWpW++Kp FT5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689008543; x=1691600543; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=twIKQ2MHmWju5IY9XdGeqwYNLAm5VOVmCmH1cwAeJvk=; b=ZxhouXaVsfCVUQ4pwObdOAYvFVi0VZxs4d2ev3d/4F7VBCaOofDWVlISASe10GNh9v W6M7Rj2ZbE/JL9AyCBFTComHDmuWa2r+5kKR1zfCaC72jZU8Eac8HiEQRxB4K3cEAASs BCybiva723LN1QSZ4syC+2Era7heu1zKiCMurEw2FSJm3RHWm/ycYfRIgWNx4TQ1r+2X qtmA3aNPqI/GPU/m7IKWzGvxbLvXo9C8CGeVTYISAUGKMFInxAcPamAWkrmMnimTLLnk 7hi3eMGXgQq3eY9/i2eWO8R/gz9H2E1+MjXQCalORFf6kQTuIQp+frvPWq99+IIFaUzb nA5g== X-Gm-Message-State: ABy/qLYRlnYbtYC16ZUqdLnhsJADk5c7prtNHrHEF3thkW/oJOY8dG50 2c7sM0uGC2gAjXOaLjRbkiiKJSDWLuhjnbGWck4= X-Received: by 2002:a05:6a00:3a2a:b0:675:8521:ddc7 with SMTP id fj42-20020a056a003a2a00b006758521ddc7mr15664306pfb.0.1689008543234; Mon, 10 Jul 2023 10:02:23 -0700 (PDT) Received: from [192.168.1.136] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id a17-20020aa78651000000b006828ee9fdaesm29514pfo.127.2023.07.10.10.02.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 10 Jul 2023 10:02:22 -0700 (PDT) Message-ID: <7e8c910f-4938-01c2-ac38-7ce89236cec1@kernel.dk> Date: Mon, 10 Jul 2023 11:02:21 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH] io_uring: Redefined the meaning of io_alloc_async_data's return value Content-Language: en-US To: Gabriel Krisman Bertazi , Lu Hongfei Cc: Pavel Begunkov , io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, opensource.kernel@vivo.com References: <20230710090957.10463-1-luhongfei@vivo.com> <87o7kjr9d9.fsf@suse.de> From: Jens Axboe In-Reply-To: <87o7kjr9d9.fsf@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/10/23 10:58?AM, Gabriel Krisman Bertazi wrote: > Lu Hongfei writes: > >> Usually, successful memory allocation returns true and failure returns false, >> which is more in line with the intuitive perception of most people. So it >> is necessary to redefine the meaning of io_alloc_async_data's return value. >> >> This could enhance the readability of the code and reduce the possibility >> of confusion. > > just want to say, this is the kind of patch that causes bugs in > downstream kernels. It is not fixing anything, and when we backport a > future bugfix around it, it is easy to miss it and slightly break the > semantics. Exactly! This is also why I'm not a fan of patches like this, and was not intending to apply it. > That's my downstream problem, of course. But at least it would be good Strictly speaking it is, but I think we have a responsibility to not have core bits be different upstream "just because". IOW, making it harder to introduce problems when backporting. And fwiw, I'm not sure I agree on the idiomatic part of it. Lots of functions return 0 for success and non-zero for an error. It's a bit odd as this one is a bool, but I'm pretty sure it used to return an actual error and this is why it looks the way it currently does. -- Jens Axboe