From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DDB1BC433EF for ; Thu, 2 Jun 2022 06:56:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7D0296B0074; Thu, 2 Jun 2022 02:56:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 782EC6B0075; Thu, 2 Jun 2022 02:56:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 694846B0078; Thu, 2 Jun 2022 02:56:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 5A7BF6B0074 for ; Thu, 2 Jun 2022 02:56:01 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 244A035327 for ; Thu, 2 Jun 2022 06:56:01 +0000 (UTC) X-FDA: 79532386122.01.1A78C91 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf16.hostedemail.com (Postfix) with ESMTP id 6A59F180071 for ; Thu, 2 Jun 2022 06:55:43 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 8F49021A2A; Thu, 2 Jun 2022 06:55:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1654152959; 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=YzFDE+Ez4wRNpO7cLy9R5InO2Y1kr0L0P9j/qEGxT6Y=; b=d8m9sCEZIsIjAfRGxDdzi/8HVtykag9NdyTtVbCy26EsKXSNlk+PiC16q6pGZs3nz7nBZ+ L92gfXivo0EyyNOw8c3obO8dgGJKBdQQElkHvg/+MyoL+vMvmKvrmXrgdlr/a0AArdOG/k gVtNXn4dODTCWZG8JOIH8zAeCCiZVWI= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 3A0312C145; Thu, 2 Jun 2022 06:55:59 +0000 (UTC) Date: Thu, 2 Jun 2022 08:55:59 +0200 From: Michal Hocko To: Yang Shi Cc: Zach O'Keefe , Alex Shi , David Hildenbrand , David Rientjes , Matthew Wilcox , Peter Xu , Song Liu , Linux MM , Rongwei Wang , Andrea Arcangeli , Axel Rasmussen , Hugh Dickins , "Kirill A. Shutemov" , Minchan Kim , SeongJae Park , Pasha Tatashin Subject: Re: [RFC] mm: MADV_COLLAPSE semantics Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=d8m9sCEZ; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf16.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 6A59F180071 X-Stat-Signature: 1kn7wbkukmyqjmyu4a47qmxseaz7jjpa X-HE-Tag: 1654152943-172257 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed 01-06-22 10:25:53, Yang Shi wrote: > On Wed, Jun 1, 2022 at 2:50 AM Michal Hocko wrote: > > > > On Tue 31-05-22 16:47:49, Yang Shi wrote: > > > On Fri, May 27, 2022 at 2:46 AM Michal Hocko wrote: > > [...] > > > > I really do not see any good reason to tightly couple kernel and user > > > > policies. Hints like MADV_{NO}HUGEPAGE are one thing and both kernel > > > > and userspace might decide to interpret them. But binding MADV_COLLAPSE > > > > to in kernel THP tunables just seems like pushing ourselves into the > > > > corner. > > > > > > I don't mean we should tightly couple kernel and user policies. I > > > think it is about how "never" is treated. AFAICT, typically sys admins > > > tend to expect "never" as a global switch and they don't expect any > > > THP allocation should happen in "never" mode even though it is > > > requested by the users. Maybe they should not expect so in the first > > > place. > > > > But this is not how the knob works, right? At least shmem has its own > > thing. So we do not have any global kill switch for transparent huge > > pages. > > Yeah, but shmem has "never" mode too, which has the same semantics and > it is the default mode actually. Since MADV_COLLAPSE just collapse > anon memory for now, so the discussion was focused on anon THP. But > shmem is same. Do you expect MADV_COLLAPSE would stick to the anonymous memory? Are we going to get MADV_COLLAPSE_SHMEM, MADV_COLLAPSE_FOR_REAL? -- Michal Hocko SUSE Labs