Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751668AbdG0P4b (ORCPT ); Thu, 27 Jul 2017 11:56:31 -0400 Received: from gum.cmpxchg.org ([85.214.110.215]:52230 "EHLO gum.cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751554AbdG0P4a (ORCPT ); Thu, 27 Jul 2017 11:56:30 -0400 Date: Thu, 27 Jul 2017 11:56:16 -0400 From: Johannes Weiner To: Ingo Molnar , Peter Zijlstra , Andrew Morton , Rik van Riel , Mel Gorman Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH 3/3] mm/sched: memdelay: memory health interface for systems and workloads Message-ID: <20170727155616.GA23665@cmpxchg.org> References: <20170727153010.23347-1-hannes@cmpxchg.org> <20170727153010.23347-4-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170727153010.23347-4-hannes@cmpxchg.org> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1409 Lines: 37 On Thu, Jul 27, 2017 at 11:30:10AM -0400, Johannes Weiner wrote: > + /* > + * The domain is somewhat delayed when a number of tasks are > + * delayed but there are still others running the workload. > + * > + * The domain is fully delayed when all non-idle tasks on the > + * CPU are delayed, or when a delayed task is actively running > + * and preventing productive tasks from making headway. > + * > + * The state times then add up over all CPUs in the domain: if > + * the domain is fully blocked on one CPU and there is another > + * one running the workload, the domain is considered fully > + * blocked 50% of the time. > + */ > + if (!mdc->tasks[MTS_DELAYED_ACTIVE] && !mdc->tasks[MTS_DELAYED]) > + state = MDS_NONE; > + else if (mdc->tasks[MTS_WORKING]) > + state = MDS_SOME; > + else > + state = MDS_FULL; Just a headsup, if you're wondering why the distinction between delayed and delayed_active: I used to track iowait separately from working, and in a brainfart oversimplified this part right here. It should really be: if (delayed_active && !iowait) state = full else if (delayed) state = (working || iowait) ? some : full else state = none I'm going to re-add separate iowait tracking in v2 and fix this, but since this patch is already big and spans two major subsystems, I wanted to run the overall design and idea by you first before doing more polishing on this.