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=-5.5 required=3.0 tests=MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 D9E66C43603 for ; Mon, 16 Dec 2019 14:02:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A555820684 for ; Mon, 16 Dec 2019 14:02:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A555820684 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 566C78E0008; Mon, 16 Dec 2019 09:02:24 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 518328E0003; Mon, 16 Dec 2019 09:02:24 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 405728E0008; Mon, 16 Dec 2019 09:02:24 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0200.hostedemail.com [216.40.44.200]) by kanga.kvack.org (Postfix) with ESMTP id 2C2A88E0003 for ; Mon, 16 Dec 2019 09:02:24 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id C858F181AEF00 for ; Mon, 16 Dec 2019 14:02:23 +0000 (UTC) X-FDA: 76271169366.21.drop84_891662c27463f X-HE-Tag: drop84_891662c27463f X-Filterd-Recvd-Size: 3351 Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Mon, 16 Dec 2019 14:02:21 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id d139so5085632wmd.0 for ; Mon, 16 Dec 2019 06:02:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=PPVkKUPHdQuhDbyrhJPZArVtxKIO++dpqLMyX5OYaQg=; b=WJe6uwuvtIdJ63UfETtm4/Im9oYp25tBLb+lXUlCMJQ/hwF02obJ8Q2gOUdHJPlPn/ WDctgge/sMz4HkiFbCLYIihcu7PwtrO2OKw118fd3A0/yutRV+E/kJt3XLGhZQv/6r8F Nwi+VrSQ79Bj7VlW0kwKQQmjxrsri9Mt2GQMkN8E5dZx+keqMCo8eXa+sj64mXNryLgz yXcdaX5dZ9iiJyLIkxd68rVRujGa5nXnSnZXvDAmtORRPtmzCAtmU3hS98CP4/Pd5krM qTxA5H+CCsTi1vKvpG5GsXkqEcL55vl1b7PzJm34M+iE9VscOOUh79EtEvDMXEZvjD13 XR6A== X-Gm-Message-State: APjAAAUGXoUEYckv4WV6l2VuKmIQRdq4+hDWfpU2vLRNxffgqvjw50vp Wj9pmT+cB7RoV+u/zZ6GQKE= X-Google-Smtp-Source: APXvYqxqJLUTD5JRPD7XF6g976GK7Ro9fMcZnkhdiXEiTCJLlmII8WZQf57vEbIG+6XkGYWb9IuhkA== X-Received: by 2002:a7b:cb54:: with SMTP id v20mr28849561wmj.11.1576504940945; Mon, 16 Dec 2019 06:02:20 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id w17sm21668962wrt.89.2019.12.16.06.02.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2019 06:02:20 -0800 (PST) Date: Mon, 16 Dec 2019 15:02:19 +0100 From: Michal Hocko To: Hillf Danton Cc: linux-kernel , linux-mm , Tejun Heo , Lai Jiangshan Subject: Re: [RFC] workqueue: fix detecting reentrance Message-ID: <20191216140219.GD6444@dhcp22.suse.cz> References: <20191212091548.21668-1-hdanton@sina.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191212091548.21668-1-hdanton@sina.com> User-Agent: Mutt/1.12.2 (2019-09-21) X-Bogosity: Ham, tests=bogofilter, spamicity=0.001625, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Cc maintainers. On Thu 12-12-19 17:15:48, Hillf Danton wrote: > > If we can find a valid worker that is serving the specified work at > the moment then the worker itself is enough to ensure reentrance and > workqueue doesn't matter here because it is permitted for a work to > requeue itself either on different cpu or numa node or even on another > workqueue. I do not follow what is the actual problem you are trying to fix here. > Fixes: c9178087acd7 ("workqueue: perform non-reentrancy test when queueing to unbound workqueues too") > Fixes: 18aa9effad4a ("workqueue: implement WQ_NON_REENTRANT") > Signed-off-by: Hillf Danton > --- > > --- f/kernel/workqueue.c > +++ g/kernel/workqueue.c > @@ -1433,7 +1433,7 @@ retry: > > worker = find_worker_executing_work(last_pool, work); > > - if (worker && worker->current_pwq->wq == wq) { > + if (worker) { > pwq = worker->current_pwq; > } else { > /* meh... not running there, queue here */ > -- Michal Hocko SUSE Labs