Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3397629pxu; Mon, 30 Nov 2020 02:05:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJy1KX1jy0Oi0spHOeJYNYArvKt1G99xo9JDDu6+COLqMTuN3hBokt/WpW0r7sYg4GHBeEfa X-Received: by 2002:a50:8f06:: with SMTP id 6mr20550796edy.39.1606730723774; Mon, 30 Nov 2020 02:05:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606730723; cv=none; d=google.com; s=arc-20160816; b=DIi7YjvATF+jhgQvRxWybz/7xdhTMkm0o896zsfYIOeK6W2hEqqgTQfyDzZcC02Ms5 arfMGmqCYgK42JSJaFL+w1glAOq3apwo6mCrkvs/3BW8rxN+ielBgmbxaHZ2lLSRycUM tFMV4MkwgRIRAbwyvewHfAuZQTR+vsHJRpT0AxvhgjbU0gN9F1JoEoZnSfuj9CtrFKoT 4JFIjBX6zQhQ9m4Uw6nQwuEylZwbfIpJpVpjDHOyh8ixlvxlykNUleDRbPAH2lpE6wCt QhpXG9/HpmAspIYJlak4HrN9qkhIaRUa9jSa9XixcupT5YZQInXS4Y6T2TI/sjwCkGRS Oq/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=K9QLAqcKegNHZ4enxhyxhkwws9hmf//rDueloPUrspE=; b=bUvc5IIeLm7jZmA4Osm8MdD/wyQM2q9ZTU3yLjumwk6v/iHErX6XJRqi3rUhcgy0Vb TRoXLAOLcphtVdHP8xLvzeQI0RkUTYPmBitHxx2B9f023mfcnVJ3OcPwdZ2MNHd1nawh 3BgM31eDihKhCZy3ABRv0CuYMjLFOGnNnp+2HPS9MQb0vo1taVeh9A8+7g0RpwI17kM/ b3usVWnv5FeyEuj4VVi+YrVoeIgaaQdAXzTwOLhr2uyOsNGyzhPDoYQyVr/dhxk5vLE5 sw5Zlr5nJOEfI+LVaKzEtDlYsIUz8u3cZaV++qYUqnxk7+lfbLzAR5kEbt/KfnZOtj2l 3eiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=Qn7UPyCg; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b8si7947338eds.509.2020.11.30.02.05.01; Mon, 30 Nov 2020 02:05:23 -0800 (PST) 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=@suse.com header.s=susede1 header.b=Qn7UPyCg; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728039AbgK3KBm (ORCPT + 99 others); Mon, 30 Nov 2020 05:01:42 -0500 Received: from mx2.suse.de ([195.135.220.15]:60462 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727105AbgK3KBl (ORCPT ); Mon, 30 Nov 2020 05:01:41 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1606730454; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=K9QLAqcKegNHZ4enxhyxhkwws9hmf//rDueloPUrspE=; b=Qn7UPyCgUNImi1+ilkAUxok8xel0jXaNJWqPi7lVT1fidlp00do2xwiZ3xUt75SXL71fnH VJtyoGDZvZ8PlDU3nCk8pvfZjhZ/uXUe8NHLFTsZ/gBIabJ2VNr9j5+VCdSI4C/skirh9l wsfC/ewhUMXTtl8mj4Owsdvss+Yi/YM= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id B3DD4ABD2; Mon, 30 Nov 2020 10:00:54 +0000 (UTC) Date: Mon, 30 Nov 2020 11:00:53 +0100 From: Michal Hocko To: Rik van Riel Cc: hughd@google.com, xuyu@linux.alibaba.com, akpm@linux-foundation.org, mgorman@suse.de, aarcange@redhat.com, willy@infradead.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, linux-mm@kvack.org, vbabka@suse.cz Subject: Re: [PATCH 2/3] mm,thp,shm: limit gfp mask to no more than specified Message-ID: <20201130100053.GD17338@dhcp22.suse.cz> References: <20201124194925.623931-1-riel@surriel.com> <20201124194925.623931-3-riel@surriel.com> <20201126134034.GI31550@dhcp22.suse.cz> <920c627330f3c7d295ab58edd1b62f28fdbd14bc.camel@surriel.com> <20201127075214.GK31550@dhcp22.suse.cz> <1f089a155d7501fb156da34744d282ae1f3d02f7.camel@surriel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1f089a155d7501fb156da34744d282ae1f3d02f7.camel@surriel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 27-11-20 14:03:39, Rik van Riel wrote: > On Fri, 2020-11-27 at 08:52 +0100, Michal Hocko wrote: > > On Thu 26-11-20 13:04:14, Rik van Riel wrote: > > > > > > I would be more than happy to implement things differently, > > > but I am not sure what alternative you are suggesting. > > > > Simply do not alter gfp flags? Or warn in some cases of a serious > > mismatch. > > E.g. GFP_ZONEMASK mismatch because there are already GFP_KERNEL users > > of > > shmem. > > Not altering the gfp flags is not really an option, > because that would leads to attempting to allocate THPs > with GFP_HIGHUSER, which is what is used to allocate > regular tmpfs pages. Right but that is a completely different reason to alter the mask and it would be really great to know whether this is a theoretical concern or those users simply do not ever use THPs. Btw. should they be using THPs even if they opt themselves into GFP_KERNEL restriction? > If the THP configuration in sysfs says we should > not > be doing compaction/reclaim from THP allocations, we > should obey that configuration setting, and use a > gfp_flags that results in no compaction/reclaim being done. Yes, I agree with that. The thing I disagree with is that you try to mix how hard to try also from the shmem users which are not really THP aware and they merely want to control how hard to try to order-0 pages. Or more precisely whether to invoke OOM killer before doing their fallback. So your patch adds a very subtle behavior that would be really hard to maintain long term because the way how hart to compact is completely detached from users who use the gfp mask. -- Michal Hocko SUSE Labs