Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4081620ybg; Tue, 29 Oct 2019 01:43:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqw0C+14YQNJNSIWBwS83jyOyA8wcLR3rNo3nBaDgjrfRd/RiKdljyyYph2W2jcWyw75DWdw X-Received: by 2002:aa7:d714:: with SMTP id t20mr24781476edq.129.1572338637154; Tue, 29 Oct 2019 01:43:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572338637; cv=none; d=google.com; s=arc-20160816; b=LhBR+/3u1jo6bQ9+q3CgIFbglLQB3dx0hVuV7vv35mlgRjmsdnuyT8T6kToBNA9Mte cb7M9+gOWisfsobn7qV3ExUc/FUEXV8Szwbzgm6iqtDNjUy7YBqKeeoOQlASBv35AqpO QOOoc3rrkT/zYgOYNioY/SNLqOyna6V2khvdPmyXB+HNyUwz3Vnb5LIeH9Wb9dtE6N4+ 0F1Vz9y0iEc2DaVvwAp+2HTrs4DE2cq30GRUmC7Q5fAagP+LFTag1pUgBQ4NTuZc4qjt tBhBx4bKhewMBuDA9MtBxsD0MXI/iwY/zj3NSszRh7raEkhEI/eKC9aZVL5oEWKGtCg+ X30w== 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; bh=i0ifmGLX/2gH662HsfxG1jOuiC7yj7CmesNi0fyyJ7k=; b=QvNFjwnyooj8WbRW+Q7Jixq8qqEXVVbfUWoiByi1KXOpVw1J2ugBU8dzu5f8D/5MGn TdLndwdg/pciNPtyudQeUMgyWHp0JPyzU6aHX+VUpGcroQ4IuffBpUOc2JOPrFQzBb6E sijpFHNPbDtONS14bA0cxF2oTgNPjEue9oPt1f0ToeS7tz1/WDrloPQlsp2NSznSFdFp 4G8rVKuz+P0FuuEN4s58Mb5DYzDS+lMY518RsVJkcdnW1HKyUpgiIApXeB0tNXkPbSS+ 3shhQL6fSqKcmW13UrCZsWYAnDnDASA3OOZK+6Df9E7eJwGnpt4IvCXNlNu2f9dAgb6u d0TA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n19si7400286ejk.264.2019.10.29.01.43.33; Tue, 29 Oct 2019 01:43:57 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727974AbfJ2Il4 (ORCPT + 99 others); Tue, 29 Oct 2019 04:41:56 -0400 Received: from mx2.suse.de ([195.135.220.15]:55120 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725854AbfJ2Il4 (ORCPT ); Tue, 29 Oct 2019 04:41:56 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 46353B039; Tue, 29 Oct 2019 08:41:54 +0000 (UTC) Date: Tue, 29 Oct 2019 09:41:53 +0100 From: Michal Hocko To: Hillf Danton Cc: linux-mm , Andrew Morton , linux-kernel , Matthew Wilcox , Johannes Weiner , Shakeel Butt , Minchan Kim , Mel Gorman , Vladimir Davydov , Jan Kara Subject: Re: [RFC v2] mm: add page preemption Message-ID: <20191029084153.GD31513@dhcp22.suse.cz> References: <20191026112808.14268-1-hdanton@sina.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191026112808.14268-1-hdanton@sina.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat 26-10-19 19:28:08, Hillf Danton wrote: > > The cpu preemption feature makes a task able to preempt other tasks > of lower priorities for cpu. It has been around for a while. > > This work introduces task prio into page reclaiming in order to add > the page preemption feature that makes a task able to preempt other > tasks of lower priorities for page. > > No page will be reclaimed on behalf of tasks of lower priorities > under pp, a two-edge feature that functions only under memory > pressure, laying a barrier to pages flowing to lower prio, and the > nice syscall is what users need to fiddle with it for instance as > no task will be preempted without prio shades, if they have a couple > of workloads that are sensitive to jitters in lru pages, and some > difficulty predicting their working set sizes. > > Currently lru pages are reclaimed under memory pressure without prio > taken into account; pages can be reclaimed from tasks of lower > priorities on behalf of higher-prio tasks and vice versa. > > s/and vice versa/only/ is what we need to make pp by definition, but > it could not make a sense without prio introduced in reclaiming, > otherwise we can simply skip deactivating the lru pages based on prio > comprison, and work is done. > > The introduction consists of two parts. On the page side, we have to > store the page owner task's prio in page, which needs an extra room the > size of the int type in the page struct. > > That room sounds impossible without inflating the page struct size, and > it is not solved but walked around by sharing room with the 32-bit numa > balancing, see 75980e97dacc ("mm: fold page->_last_nid into page->flags > where possible"). > > On the reclaimer side, kswapd's prio is set with the prio of its waker, > and updated in the same manner as kswapd_order. > > V2 is based on next-20191018. > > Changes since v1 > - page->prio shares room with _last_cpupid as per Matthew Wilcox > > Changes since v0 > - s/page->nice/page->prio/ > - drop the role of kswapd's reclaiming prioirty in prio comparison > - add pgdat->kswapd_prio > > Cc: Matthew Wilcox > Cc: Michal Hocko > Cc: Johannes Weiner > Cc: Shakeel Butt > Cc: Minchan Kim > Cc: Mel Gorman > Cc: Vladimir Davydov > Cc: Jan Kara > Signed-off-by: Hillf Danton As already raised in the review of v1. There is no real life usecase described in the changelog. I have also expressed concerns about how such a reclaim would work in the first place (priority inversion, expensive reclaim etc.). Until that is provided/clarified Nacked-by: Michal Hocko Please do not ignore review feedback in the future. -- Michal Hocko SUSE Labs