Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp519219pxu; Fri, 23 Oct 2020 07:00:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFO5jBJMAN5/39u3rQ7aYUBqZQNOsLw8PyIOhKFey+Nk/3ehhD2MDyWb/GDvLCBJ/5mrAM X-Received: by 2002:a17:906:c7d9:: with SMTP id dc25mr2084283ejb.482.1603461649356; Fri, 23 Oct 2020 07:00:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603461649; cv=none; d=google.com; s=arc-20160816; b=dskGuzKBRNCncBpYG28wzNkU/x23FyPwzYDxjXR30QnNyEugbf3lH8iEDnnJgRzqJQ kJeRKFPqjlaIeKNeaVJ3WjsYaTvCbO/ZiTAHBBccheB1J1kagx2bPj+84esJODrb66dz qdxElOFbhxFrfcKNvaNYNO+kUGXQnk1kKYHQ1NVk3WpNHPpBNXP6eP9wsGIsQpMYfElh rSU4SVkpZTonq2wvBNbfaorSp7bBz8cohaqT46moC3cCI1UWV5gyzqo5pDs1LnrpLgs3 j1fUdh7KYzszhfMLq+eE9mppV2BfoHSUK0x0mAEix8IvGYB8/wPpYkja+vL1WsbaH8p3 e+bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=IilmWqQBIzdGRFEb8WDv/BGb6Zru01TJYp2UzzvimNo=; b=pHR+APaaHKAp9JdIAUX8He2l6/zGbqWtEBcFRLhMdslykdDy7RXh5xqbXoHoh6SLaw jrKeeNK3KqnL0xFRIIkNqdQrgTNa0d/fQW7tpVQysL+s226GWI+/OUN59oUCw64qRXI7 ETTdJKTSA1uZm9M2An6whckZsF8m8Or1moIc9QDjHy8BAU9AJldCiatERu+GPD12TVg3 2iBHtJuQ6cr+ygUMDmlUSrrsJKwkcuwB3TxdHQQQ2LLaJYOZ2bgxdPLlnZq86aPFVzaR DLwhZraMDBu7YohmMCPBeuY5l+rOhbZHzyMjMvZ4BOneHD8ZBGU5r2w4wQKu5iYGjwuk TXFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=wpeItj4Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b8si882500ejp.403.2020.10.23.07.00.26; Fri, 23 Oct 2020 07:00:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=wpeItj4Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S374555AbgJWCYT (ORCPT + 99 others); Thu, 22 Oct 2020 22:24:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S374540AbgJWCYT (ORCPT ); Thu, 22 Oct 2020 22:24:19 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09352C0613CE for ; Thu, 22 Oct 2020 19:24:19 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id h6so12492pgk.4 for ; Thu, 22 Oct 2020 19:24:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=IilmWqQBIzdGRFEb8WDv/BGb6Zru01TJYp2UzzvimNo=; b=wpeItj4YfzkY9NGX9eDHOZimPqRVq75UcGTuCiNxcwnlDWgOiW57hJ3NtX0tTfJp2E x2gbYpQzowr6u+7nM+r93TWzmVJxllGDoUTgZ049kEHsNpVgR0XoNyr4ckDamD/ih83h wrS82wdQoSkFPu8fwQVOA/taOU3+U89m7ITVz3gRrXAq8FpurjLUryK6+7jU8zFmVfBl bOqk86u+zEi7/njiX3F6GTKjlUlx6FUlQf1ixvdQwrqtmllqDIuFudNIsYqinCpgCbTH WlHaXTrHm+w7bpds8L3b4oGt1U2zNH03mToy3yfk3NWzqy8UBC2j6sYRhEksUGnNfc9Y uNiQ== 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-language :content-transfer-encoding; bh=IilmWqQBIzdGRFEb8WDv/BGb6Zru01TJYp2UzzvimNo=; b=G3jWe6Wre7v90bTyJSwCIgxp8W4zfOqkv2gD3RUlLtjAY4vk/3zsIjIoNSs2eAZils /hyVYRHQT5IKhDy+u0WLXqKqsfSi6rFZhYepW0a9PXIorXssMxKagbVE2pJh9AQA1ImM 9FqWeDRLTS4r0ctppAHDeuBO7aAOMQp5/aNMCVNAF1N479sOVanmOMUfYV2NNC/PnRSv dWdXUO7lf8MKZ75i/Z3hJLyEDjBTFlaLU3Fqi4EEHlDJSXOmdPOLLy273mPQlOQXbLxX v5Uzrl7Er4fptf8NAIMGYZn+EKHjB4uvkIdAOXO2n7nWFNfUgCIMtqwmKH6COtSKAqr0 xXYA== X-Gm-Message-State: AOAM533oNBE+8oJpH3CKyZ0V3o6ruLoVUHlHWB+xiDJgBLHvZo87yRC+ OLn/Voo2febzuE+5oDrgkVbIRg== X-Received: by 2002:a62:a10a:0:b029:154:fd62:ba90 with SMTP id b10-20020a62a10a0000b0290154fd62ba90mr10722pff.62.1603419858432; Thu, 22 Oct 2020 19:24:18 -0700 (PDT) Received: from [192.168.1.134] ([66.219.217.173]) by smtp.gmail.com with ESMTPSA id g85sm82708pfb.4.2020.10.22.19.24.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Oct 2020 19:24:17 -0700 (PDT) Subject: Re: Question on io-wq To: Hillf Danton Cc: Zhang Qiang , viro@zeniv.linux.org.uk, io-uring@vger.kernel.org, Pavel Begunkov , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org References: <98c41fba-87fe-b08d-2c8c-da404f91ef31@windriver.com> <20201023020514.2230-1-hdanton@sina.com> From: Jens Axboe Message-ID: Date: Thu, 22 Oct 2020 20:24:16 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201023020514.2230-1-hdanton@sina.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/22/20 8:05 PM, Hillf Danton wrote: > On Thu, 22 Oct 2020 08:08:09 -0600 Jens Axboe wrote: >> On 10/22/20 3:02 AM, Zhang,Qiang wrote: >>> >>> Hi Jens Axboe >>> >>> There are some problem in 'io_wqe_worker' thread, when the >>> 'io_wqe_worker' be create and Setting the affinity of CPUs in NUMA >>> nodes, due to CPU hotplug, When the last CPU going down, the >>> 'io_wqe_worker' thread will run anywhere. when the CPU in the node goes >>> online again, we should restore their cpu bindings? >> >> Something like the below should help in ensuring affinities are >> always correct - trigger an affinity set for an online CPU event. We >> should not need to do it for offlining. Can you test it? > > CPU affinity is intact because of nothing to do on offline, and scheduler > will move the stray workers on to the correct NUMA node if any CPU goes > online, so it's a bit hard to see what is going to be tested. Test it yourself: - Boot with > 1 NUMA node - Start an io_uring, you now get 2 workers, each affinitized to a node - Now offline all CPUs in one node - Online one or more of the CPU in that same node The end result is that the worker on the node that was offlined now has a mask of the other node, plus the newly added CPU. So your last statement isn't correct, which is what the original reporter stated. -- Jens Axboe