From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E538C432BE for ; Wed, 1 Sep 2021 02:52:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5AF63600D0 for ; Wed, 1 Sep 2021 02:52:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241770AbhIACxB (ORCPT ); Tue, 31 Aug 2021 22:53:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:41350 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241648AbhIACxA (ORCPT ); Tue, 31 Aug 2021 22:53:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630464723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=22daRUQV9U4yr6Wt0e3afK9IF5RqMvZ3yQMarWKzKaw=; b=JxkWfQ7EGfdRby2Hd9j56rPsXil9S4cm2C3FAZXX5OO7cUDSxFTYinqBbb3iSpD6TdXSJT 6PrikPnEDTcBMAOb1V26OPOx1bsNDR+/Rg4qYR1bHBBiYO3xsUrVrBd9lpGTuUWxbipX6o bPgZ3hpHWHlyTA3A+VvZuKPecQT/dm4= Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-561-v7A3T5YcOWSK4UgGillQ3w-1; Tue, 31 Aug 2021 22:52:02 -0400 X-MC-Unique: v7A3T5YcOWSK4UgGillQ3w-1 Received: by mail-pg1-f197.google.com with SMTP id d1-20020a630e010000b029023afa459291so812526pgl.11 for ; Tue, 31 Aug 2021 19:52:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=22daRUQV9U4yr6Wt0e3afK9IF5RqMvZ3yQMarWKzKaw=; b=nTFMpDQhEqPHWAaz2gvoajuE8HICREfKnYXYqBQLWj8Hf9D2d0HrKqNyJS3SR459i3 11P+qkCxzgnumJugT33H8e5v1VJGaAjRoW0WEHkJKJtYRK5e467C78ROR4f0HfdOaROt l6vq6DQFYfU0d7ptlHXh9Ke2kDBEc7Smu4+cgs4PjXm4DrF7ZbjM0qLGe317HSOKspA3 smA5ENxf4zBewLNOLAw8d8ZgErQ8HxXeBeNJMiyPZDa0ww+3YLG16mpWym5fG3sIXCky P6GUZjmpU9Pa/eVGLwwHpFi4VUkhb1r7qKciZAxqNlxbLF50jn+EbCLpKsgm3PdshUIJ J5lQ== X-Gm-Message-State: AOAM532BiNReU+j1XAU1f081OgccZ4knKc7pyFsUmiVFC6rl95nFhrNe AHmfoQ7PaTkh1376OjrL9vriHEnrdiYXhNylS+SNvwoH8AlBi7vVpndsPmxstGvDW+aNaTLzoG6 cmajZVyMoTlkW X-Received: by 2002:a17:902:ea89:b0:134:7eb7:b4d7 with SMTP id x9-20020a170902ea8900b001347eb7b4d7mr7633966plb.43.1630464721016; Tue, 31 Aug 2021 19:52:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTWS6gU6vtbRqrdbv/Yqpra3725hn41k3JbwUi9Z5AqTrEe2L3d1WI2eNmIrtm6tnQdkeYWQ== X-Received: by 2002:a17:902:ea89:b0:134:7eb7:b4d7 with SMTP id x9-20020a170902ea8900b001347eb7b4d7mr7633932plb.43.1630464720692; Tue, 31 Aug 2021 19:52:00 -0700 (PDT) Received: from wangxiaodeMacBook-Air.local ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id b7sm19703920pgs.64.2021.08.31.19.51.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 31 Aug 2021 19:51:59 -0700 (PDT) Subject: Re: [PATCH v13 02/13] eventfd: Export eventfd_wake_count to modules To: Xie Yongji , mst@redhat.com, stefanha@redhat.com, sgarzare@redhat.com, parav@nvidia.com, hch@infradead.org, christian.brauner@canonical.com, rdunlap@infradead.org, willy@infradead.org, viro@zeniv.linux.org.uk, axboe@kernel.dk, bcrl@kvack.org, corbet@lwn.net, mika.penttila@nextfour.com, dan.carpenter@oracle.com, joro@8bytes.org, gregkh@linuxfoundation.org, zhe.he@windriver.com, xiaodong.liu@intel.com, joe@perches.com, robin.murphy@arm.com, will@kernel.org, john.garry@huawei.com Cc: songmuchun@bytedance.com, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, kvm@vger.kernel.org, linux-fsdevel@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org References: <20210831103634.33-1-xieyongji@bytedance.com> <20210831103634.33-3-xieyongji@bytedance.com> From: Jason Wang Message-ID: <0e486c0a-0055-e698-ffd2-31c4b75dae5d@redhat.com> Date: Wed, 1 Sep 2021 10:50:40 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210831103634.33-3-xieyongji@bytedance.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 在 2021/8/31 下午6:36, Xie Yongji 写道: > Export eventfd_wake_count so that some modules can use > the eventfd_signal_count() to check whether the > eventfd_signal() call should be deferred to a safe context. > > Signed-off-by: Xie Yongji And this matches the comment inside eventfd_signal():         /*          * Deadlock or stack overflow issues can happen if we recurse here          * through waitqueue wakeup handlers. If the caller users potentially          * nested waitqueues with custom wakeup handlers, then it should          * check eventfd_signal_count() before calling this function. If          * it returns true, the eventfd_signal() call should be deferred to a          * safe context.          */ So: Acked-by: Jason Wang > --- > fs/eventfd.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/fs/eventfd.c b/fs/eventfd.c > index e265b6dd4f34..1b3130b8d6c1 100644 > --- a/fs/eventfd.c > +++ b/fs/eventfd.c > @@ -26,6 +26,7 @@ > #include > > DEFINE_PER_CPU(int, eventfd_wake_count); > +EXPORT_PER_CPU_SYMBOL_GPL(eventfd_wake_count); > > static DEFINE_IDA(eventfd_ida); >