Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F5B2C636D6 for ; Thu, 16 Feb 2023 13:33:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229788AbjBPNdW (ORCPT ); Thu, 16 Feb 2023 08:33:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229717AbjBPNdU (ORCPT ); Thu, 16 Feb 2023 08:33:20 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2796B59B5A; Thu, 16 Feb 2023 05:33:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=FN9D4k4in1bDBo/daLEAKvVZkKm0gfZWwwcy44PDlmE=; b=GakoIeAf57y2vs7Q0oE+KFu/ug 8/uC6WcbsHuP/Q3aTR4oMpvuWi2DLeIPbgruviIIDBh0noFzMy7IkY3873zDUoDeEMROSopbnOsjr nwr0dyDjEcPe0pRwa9/puHNi0tij2hlu4afQQ5BUoUsh4mzdv02V1xGrg+0m3q+79F3zjcUwyH40r 44H19wub8OHrc98G5hFj78kUzCI+8A7/M9ttmVqgwO+TiGAD/l49Kec8s6Ew5qbapgnShK7ufMpi9 QtyYHt09P1LC1EDvnMT2d7GAcZe3arq4AyH4jzdH9ZH5DRUGfpp3laHL9vk6Yzby81Cp9dkq3bHew 9zASgkqA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pSeNk-008Rm5-0k; Thu, 16 Feb 2023 13:33:04 +0000 Date: Thu, 16 Feb 2023 13:33:03 +0000 From: Matthew Wilcox To: wenyang.linux@foxmail.com Cc: Alexander Viro , Christoph Hellwig , Dylan Yudaken , Jens Axboe , David Woodhouse , Fu Wei , Paolo Bonzini , Michal Nazarewicz , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] eventfd: use wait_event_interruptible_locked_irq() helper Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 16, 2023 at 01:29:00PM +0000, Matthew Wilcox wrote: > On Thu, Feb 16, 2023 at 09:17:39PM +0800, wenyang.linux@foxmail.com wrote: > > + res = wait_event_interruptible_locked_irq( > > + ctx->wqh, ULLONG_MAX - ctx->count > ucnt) ? > > + -ERESTARTSYS : sizeof(ucnt); > > You've broken the line here in a weird way. I'd've done it as: > > res = wait_event_interruptible_locked_irq(ctx->wqh, > ULLONG_MAX - ctx->count > ucnt) ? > -ERESTARTSYS : sizeof(ucnt)); > > ... also the patch you've sent here doesn't even compile. Have you > tested it? Sorry, I misread it. But I would have avoided use of the ?: operator here ... res = wait_event_interruptible_locked_irq(ctx->wqh, ULLONG_MAX - ctx->count > ucnt); if (res == 0) res = sizeof(ucnt);