Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1315617imu; Mon, 5 Nov 2018 18:28:53 -0800 (PST) X-Google-Smtp-Source: AJdET5ek6TN9blsfG8A8c7p8n9Ib4R1GfPnSl5PXNXSKHmFdLCJC5M0EkcyGBdo6TePxxJH8aZSz X-Received: by 2002:a63:181c:: with SMTP id y28mr21639974pgl.75.1541471332981; Mon, 05 Nov 2018 18:28:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541471332; cv=none; d=google.com; s=arc-20160816; b=h0WPgaRBs2sKfyzAA/t+aG4H/nJP/jnQhDipgN0v4x60oKGKzbYe8muMdMPuB2QwGa HnCG0Tp5Ju1uVXOcYghGqqvU1TP0JSY6jYo18CqNSUrarmezIuelJujt9x5hOu0jjVKg ayTp6wjPmeLEmX44e2on38osX66TW5VN/EmbaEIPNm4rMjjdFk3FXRcyLefyXiGRebbj x7wCiAFTExbzJEw4Y4VRJ1WK+sUkKX6TexWFJIY/nI0tJxzmBFoAbnsSjkvJ0YE9hmpS v2GU+a9unjY3p+mqn4FgLEmP0bROstNbIHO4oNxvJRIX//ZgEV0kJFi3LM3SrDFMJJQ3 sItw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Pq0q7fgYlsXP5RgqD/ux4NPF+hjznz6JNMGk9EFGCHA=; b=f36eo5xj71txI4MeVlPcP5yno1COPbP40v0QT4HZULNg84EeLIFuMBOyLw7yYN0LOY E+EPhnjj90r8KCzeNeeLSL1I13ar0koFsq1mRuIR0ymyOKkmFtZJrw/JjRlGCwt+vrW5 87UAd34yw/Zcjeplc5osRS8ZwPb4Dfil2DZbRYxDanSWgjC6wiEX8VtaetTszGfLDlwf WezPQWDzpmcxAF75zk+LEjkOiuVpaBqyw7vtj7+xpzPxBIyo+ms9LGwFYssXFM8nMfAH tmi8dW0yrxXzg8sLiNp2hvS0fLxtGjnfqzj0nCIEc264Q22+Y8sVELkOYm8kQIaxHl5t xbNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=eCLGfUhX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d37-v6si35381196plb.167.2018.11.05.18.28.37; Mon, 05 Nov 2018 18:28:52 -0800 (PST) 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=@oracle.com header.s=corp-2018-07-02 header.b=eCLGfUhX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729465AbeKFLvF (ORCPT + 99 others); Tue, 6 Nov 2018 06:51:05 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:39454 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726389AbeKFLvF (ORCPT ); Tue, 6 Nov 2018 06:51:05 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wA62OcTJ164427; Tue, 6 Nov 2018 02:27:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=Pq0q7fgYlsXP5RgqD/ux4NPF+hjznz6JNMGk9EFGCHA=; b=eCLGfUhXJy3NNnUbYoOxqAFyWK2mN9QnHvnhr+D1F1U+wJ9G1vXXEnMact9AsNqywx8u Kd+5b9uTClXwtzPSom6FFqoPnZUwHVnRMOd4FYr3IAgdGELVP38LgPpxpyNif8IRmahR uEUex8/4lMqM1ljrcs0KiDzMEaygASemmV4YknYgWQ3392w5+LJHh8VgrAjGV0p1IA4C 9BtyGvTsSKLADaiJzb1toboOm5F7kie/9T5Qcd6qOpih0BOVkwXMs2WRdv0xsvJUQ6FZ Tja1dogiLip3sGDBZyTfwe7xdG93G1nXbYLLExTvLYX9KaJvxkCfXnO/COGrr6jMgu7m RQ== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2120.oracle.com with ESMTP id 2nh3mpjjq6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 06 Nov 2018 02:27:42 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wA62Rgvh013083 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 6 Nov 2018 02:27:42 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wA62ReFd031986; Tue, 6 Nov 2018 02:27:41 GMT Received: from ca-dmjordan1.us.oracle.com (/10.211.9.48) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 05 Nov 2018 18:27:40 -0800 Date: Mon, 5 Nov 2018 18:27:47 -0800 From: Daniel Jordan To: Randy Dunlap Cc: Daniel Jordan , linux-mm@kvack.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, aarcange@redhat.com, aaron.lu@intel.com, akpm@linux-foundation.org, alex.williamson@redhat.com, bsd@redhat.com, darrick.wong@oracle.com, dave.hansen@linux.intel.com, jgg@mellanox.com, jwadams@google.com, jiangshanlai@gmail.com, mhocko@kernel.org, mike.kravetz@oracle.com, Pavel.Tatashin@microsoft.com, prasad.singamsetty@oracle.com, steven.sistare@oracle.com, tim.c.chen@intel.com, tj@kernel.org, vbabka@suse.cz Subject: Re: [RFC PATCH v4 01/13] ktask: add documentation Message-ID: <20181106022747.dmtq24pvulcnv3lc@ca-dmjordan1.us.oracle.com> References: <20181105165558.11698-1-daniel.m.jordan@oracle.com> <20181105165558.11698-2-daniel.m.jordan@oracle.com> <7693f8a2-e180-520a-0d07-cc3090d2139f@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7693f8a2-e180-520a-0d07-cc3090d2139f@infradead.org> User-Agent: NeoMutt/20180323-268-5a959c X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9068 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1811060017 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 05, 2018 at 01:19:50PM -0800, Randy Dunlap wrote: > On 11/5/18 8:55 AM, Daniel Jordan wrote: > > Hi, > > > +Resource Limits > > +=============== > > + > > +ktask has resource limits on the number of work items it sends to workqueue. > > to a workqueue. > or: to workqueues. Ok, I'll do "to workqueues" since ktask uses two internally (NUMA-aware and non-NUMA-aware). > > > +In ktask, a workqueue item is a thread that runs chunks of the task until the > > +task is finished. > > + > > +These limits support the different ways ktask uses workqueues: > > + - ktask_run to run threads on the calling thread's node. > > + - ktask_run_numa to run threads on the node(s) specified. > > + - ktask_run_numa with nid=NUMA_NO_NODE to run threads on any node in the > > + system. > > + > > +To support these different ways of queueing work while maintaining an efficient > > +concurrency level, we need both system-wide and per-node limits on the number > > I would prefer to refer to ktask as ktask instead of "we", so > s/we need/ktask needs/ Good idea, I'll change it. > > +of threads. Without per-node limits, a node might become oversubscribed > > +despite ktask staying within the system-wide limit, and without a system-wide > > +limit, we can't properly account for work that can run on any node. > > s/we/ktask/ Ok. > > + > > +The system-wide limit is based on the total number of CPUs, and the per-node > > +limit on the CPU count for each node. A per-node work item counts against the > > +system-wide limit. Workqueue's max_active can't accommodate both types of > > +limit, no matter how many workqueues are used, so ktask implements its own. > > + > > +If a per-node limit is reached, the work item is allowed to run anywhere on the > > +machine to avoid overwhelming the node. If the global limit is also reached, > > +ktask won't queue additional work items until we fall below the limit again. > > s/we fall/ktask falls/ > or s/we fall/it falls/ 'ktask.' Will change. > > + > > +These limits apply only to workqueue items--that is, helper threads beyond the > > +one starting the task. That way, one thread per task is always allowed to run. > > > thanks. Appreciate the feedback!