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 D2DF5C433F5 for ; Tue, 24 May 2022 13:26:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 27DDE8D0003; Tue, 24 May 2022 09:26:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 22CE88D0001; Tue, 24 May 2022 09:26:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 13EED8D0003; Tue, 24 May 2022 09:26:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 000C88D0001 for ; Tue, 24 May 2022 09:26:45 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id BDA36353C5 for ; Tue, 24 May 2022 13:26:45 +0000 (UTC) X-FDA: 79500711570.25.1EA3FA0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf24.hostedemail.com (Postfix) with ESMTP id 92534180024 for ; Tue, 24 May 2022 13:26:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653398804; h=from:from:reply-to:subject:subject: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=rxOgjHjtniI6ojA16l39cp5hJCymYlAdqMy5fb4iAA8=; b=S8BdLmux51pLiX6wIa11aPST5enS2fyqpjFuM1ofubVUjnkyvojW9EluujwV6bUHAzaV7e FmSna0w6hQa+9gI6HLESsVweoixhTiyl5fGnJJAiySGHsPrcC5HKijfAColOduno2nTsYV U9q+3g2sAWQEDhf+UJlD9Xh+3Z7MyoU= Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-159-Z66OhdNrMBOywBo6S9S0eg-1; Tue, 24 May 2022 09:26:42 -0400 X-MC-Unique: Z66OhdNrMBOywBo6S9S0eg-1 Received: by mail-io1-f72.google.com with SMTP id b12-20020a6b7c4c000000b0066570f0b704so2122248ioq.7 for ; Tue, 24 May 2022 06:26:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=rxOgjHjtniI6ojA16l39cp5hJCymYlAdqMy5fb4iAA8=; b=zi44h25nxKpLCiaFPjZ2uTBU+XLR3ljVzpV0ksh4kETtmAdTPWE0bnRIPBqtNMPZ+e a315cTxCc3Ja7RogdbsGgXeyPKR+02M2UwvcCXtfjZp0skz99vp1xWacE86zhxNC0Z+q cFscrepykTEph9yGSv6VlZTvxjm/vCGwv8cfk4RbB0BcnUI9cr6otF24bJxHMoS8M7mP /ttSK5hPt/pAPN2KWF3TJS9mKCQx+ke6hwFhfiP2wTtMnL3rWiNauYnC8LtphadSTszF Q3wHyZVEkSXiDWLTwz4DdpD54pq4wCkbxQZQBCgX0Qdb49lD+78SRuTgdUZRKQzynmG0 jLyQ== X-Gm-Message-State: AOAM533mjbU21sYRN/13RsRa6N6rjaQwcqWG3XCBwMmOBCimVgRxOdow gOUKgImqybKj9jll/602DALH+dYE8FoRUpdaVZrzed8p+IGv0EgL0bmU0VpOIVJzFQIjuN0DebL HWDrLBQkH3iE= X-Received: by 2002:a92:cda6:0:b0:2d1:bc06:1d9b with SMTP id g6-20020a92cda6000000b002d1bc061d9bmr2995753ild.16.1653398802202; Tue, 24 May 2022 06:26:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyshoU46rP+e9S21cMmva1Ac1u/vHVBRy7grp3LXU0hRXhBEXRjRtNzBu3qlwYDr/+pSUmMww== X-Received: by 2002:a92:cda6:0:b0:2d1:bc06:1d9b with SMTP id g6-20020a92cda6000000b002d1bc061d9bmr2995733ild.16.1653398801954; Tue, 24 May 2022 06:26:41 -0700 (PDT) Received: from xz-m1.local (cpec09435e3e0ee-cmc09435e3e0ec.cpe.net.cable.rogers.com. [99.241.198.116]) by smtp.gmail.com with ESMTPSA id p13-20020a6b8d0d000000b0065e4641e78asm4278792iod.31.2022.05.24.06.26.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 May 2022 06:26:41 -0700 (PDT) Date: Tue, 24 May 2022 09:26:39 -0400 From: Peter Xu To: Zach O'Keefe Cc: Alex Shi , David Hildenbrand , David Rientjes , Matthew Wilcox , Michal Hocko , Song Liu , Yang Shi , linux-mm@kvack.org, rongwei.wang@linux.alibaba.com, 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 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 92534180024 X-Stat-Signature: sr1m5s4otueaanyxyettyqc6mpun8s5h X-Rspam-User: Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=S8BdLmux; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf24.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=peterx@redhat.com X-HE-Tag: 1653398792-605456 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 Mon, May 23, 2022 at 05:18:32PM -0700, Zach O'Keefe wrote: > (*) If we could verify that "never" THP mode was used _only_ for > debugging, then I'd actually opt to ignore "never" in MADV_COLLAPSE. Some real time users may have used thp=never to make sure there's no pgtable uncertainty in all cases (and pages will always be mlocked for the RT apps, so pre-faulted). Debattably it's the same as TRANSPARENT_HUGEPAGE=n but the user might want to use the same kernel with other purpose where thp could still be wanted? I've no solid clue. It's just that as long as we have the knob taking "never" as an option then people may be using it, I'm afraid. "no" is indeed stronger than "yes" in many cases, at least for thp it's always like that: thp=never will guarantee no thp globally, while thp=always will only provide thp when it's still possible. The same to MADV_[NO]HUGEPAGE but just for vmas. From that POV I think your current plan looks reasonable on respecting "no"s more than "yes"s for both layers. Thanks, -- Peter Xu