Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3914801ybi; Mon, 27 May 2019 08:00:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqxdJW1AIzkKSEM003YIx6G5qR1OPT8wVig/e+A8XgzmGkN9pXN/5F/PXrHSx49xktHzPsct X-Received: by 2002:a17:90a:9dc1:: with SMTP id x1mr32151479pjv.102.1558969205118; Mon, 27 May 2019 08:00:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558969205; cv=none; d=google.com; s=arc-20160816; b=DfVaCEt1VV6bkdMC9e0Y7zuPE24Qic4tTl5I5FLhAXJe+sxa5J1Fy0JT5+U6ULfPOl M2Qc12Qp/Br3qcOvdmfPahR9v7FAnAI9YEIh/USVouVF33PtNaj8w3Next3EW/UCJ+hf ms16sHyxthBMsy5TbRBXkjYnk7Kq6EtWGyVDXe6rT2GVmgqQm0sth9kRRuoN5/xNv8Eh 1gj1uJyZDeTbux5gmn3i29estJfuxbiTjCvFNXXa1U87THkkqfoFMxkXndrmi7iYfDDb qbT+BUCwso7AdrS2HSUZHHmcg5U9D8GK1VazZr4N/GMRV1FVFs+K1nR09MCzxNlW9a+q LKRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=1HDorn020b95P5QjIbImPQwcjN3fb+vcklwL0uBNOB4=; b=oPiofCZf++tOOjVrEiMXUJXn9oj6OxIa9s9E6jEdMZdXpmRm5HKRTolCK1EVjmC+Bw 1jXcQgHAUBxvPA35BNIhS9okbTAzADKAWmCV0w91m83w9w7574ThYc8+tmi585Uzx0HG nfKUFnSHBRXNRtMFu9dRXI7WRoHASG+f1vf5NW4zdPStxLlxjHUoq6Kl/Fuq3kxVM87K wfqqYgifUQ9a3T6s1joiPWG1dv5yKCcZBzfSx+nZe0N6QNM3vsrVjF0IUuDh7JCM4u+q UXKBAcDp1V1ZBSI2f9JdXF9q4mHnbBFEnLTWKrlmg/1/KWh4bWt0fPvDXau2xUlPCfj4 CP4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=dj+snbli; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p67si10696228pga.183.2019.05.27.07.59.48; Mon, 27 May 2019 08:00:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=dj+snbli; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726506AbfE0O6m (ORCPT + 99 others); Mon, 27 May 2019 10:58:42 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:45494 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726334AbfE0O6m (ORCPT ); Mon, 27 May 2019 10:58:42 -0400 Received: by mail-pl1-f193.google.com with SMTP id a5so7133860pls.12 for ; Mon, 27 May 2019 07:58:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1HDorn020b95P5QjIbImPQwcjN3fb+vcklwL0uBNOB4=; b=dj+snbli8MeuVtvvWOX0i/MgbvyzGrxJcDF9vmnzSVKk7tykrUDOwHIe0eqGnKqEQF JcPGQ+qnbkHlQvwQeWdUR+LHeDyKaaPE3RFknEp5S1+TQORd4cEyFUq5EMm7dyzR4mFi upaD0ePc29TkvHC5B0c+5ygI+RdqlJNm5tjiPVLJF3vUf1EbGbSJ/HKf62lZMk34fsys MRfCsiCQF+GIlEGEJCP77ri459CbTyQ+FpWZvUXHa3syNXvzxorKjYWboz6cPuZZuNEj rA+DJ0hkB+h5/9Zkst1UTmXo06udSQ/RM9snSQXx7K/Xg4XmeC/cCd30X4X9/fjkm+Xk GByA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=1HDorn020b95P5QjIbImPQwcjN3fb+vcklwL0uBNOB4=; b=PfN6uoAIW3f4Uc57cUMi/CITfYx6rn2pNSRqdZ9aJNh3Xw0V+x426sGUuifsD6jaNG 0kT6gxHF0UvOGlEWBZJptxz3KYH9T5zM4ursLbiQDj0P1FkYaAV9Sn3J8VxahZJoaTkq f5oxyb/N3Z1wNlT5l8OA1kVkP+TraFn8ALI4MtkzXLjckeTf0s32fod0TCpftN+HjT7n 6vMJbIPLecYqO0fXDjPn7MEtjdKVSVsVFq2SWbY1szCTa1GFSIAMLHjK3Ab5U/NPPw4p PpmAc1uv+JZgkSQZ5AtvCvIIh8BpY6luqZ6nHdCgo2SD0sbpnBWHJa3cwvUODf7sPIcZ gyOQ== X-Gm-Message-State: APjAAAU8wP08rfe7TsWqokb50sEWWpF/qO/nnUOP0Tiq1UT/rQ8pPMu9 nAvbZJrOVNj50oLqiAVWSeUlNw== X-Received: by 2002:a17:902:9a43:: with SMTP id x3mr3162302plv.35.1558969121537; Mon, 27 May 2019 07:58:41 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id s12sm9701811pji.30.2019.05.27.07.58.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 May 2019 07:58:41 -0700 (PDT) Date: Mon, 27 May 2019 07:58:38 -0700 From: Stephen Hemminger To: Yunsheng Lin Cc: , , , , , Subject: Re: [PATCH net-next] net: link_watch: prevent starvation when processing linkwatch wq Message-ID: <20190527075838.5a65abf9@hermes.lan> In-Reply-To: <1558921674-158349-1-git-send-email-linyunsheng@huawei.com> References: <1558921674-158349-1-git-send-email-linyunsheng@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 27 May 2019 09:47:54 +0800 Yunsheng Lin wrote: > When user has configured a large number of virtual netdev, such > as 4K vlans, the carrier on/off operation of the real netdev > will also cause it's virtual netdev's link state to be processed > in linkwatch. Currently, the processing is done in a work queue, > which may cause worker starvation problem for other work queue. > > This patch releases the cpu when link watch worker has processed > a fixed number of netdev' link watch event, and schedule the > work queue again when there is still link watch event remaining. > > Signed-off-by: Yunsheng Lin Why not put link watch in its own workqueue so it is scheduled separately from the system workqueue?