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 D7AF3C433EF for ; Fri, 11 Feb 2022 08:43:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 39FC36B0074; Fri, 11 Feb 2022 03:43:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3500E6B0075; Fri, 11 Feb 2022 03:43:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1F1716B0078; Fri, 11 Feb 2022 03:43:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0098.hostedemail.com [216.40.44.98]) by kanga.kvack.org (Postfix) with ESMTP id 10B1A6B0074 for ; Fri, 11 Feb 2022 03:43:52 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id CAFAC180AC321 for ; Fri, 11 Feb 2022 08:43:51 +0000 (UTC) X-FDA: 79129861062.28.F9418C9 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf31.hostedemail.com (Postfix) with ESMTP id 5874020007 for ; Fri, 11 Feb 2022 08:43:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644569030; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=T1tDnrHIbG9LXNEmLQIdCuYtaS1n3f83/zIK/VL9XPM=; b=KyeSzzpUIMVYEmmyUW0obpvVqAeVc68miUOwjOgK/3tXRnQ3DMRtKHpLadAs0vpoM/8pSb hOT8sTSmPrbshpAqj2R/qUJAbsiPlQpDEcn3dwlgiZlAkXOUa3AkDLVyaIU8/EIlLd5Exx qDGC8G+Zbo1hJEbwap2DGEOrrWeFhUI= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-102-Eq70nSxXNb20pqbA5EeHuQ-1; Fri, 11 Feb 2022 03:43:49 -0500 X-MC-Unique: Eq70nSxXNb20pqbA5EeHuQ-1 Received: by mail-wr1-f72.google.com with SMTP id w7-20020adfbac7000000b001d6f75e4faeso3616350wrg.7 for ; Fri, 11 Feb 2022 00:43:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:to:cc:references:from:organization:subject :in-reply-to:content-transfer-encoding; bh=T1tDnrHIbG9LXNEmLQIdCuYtaS1n3f83/zIK/VL9XPM=; b=C+sSjFGadm9w2826lIHFWKFwtynC3APr9nda38ne//pqlwaXN3oAFSMQfitPHJ7tpZ bhb1a/pid69Gh5SX+YkDAcXn3+Jx312TT6NxsCLGBA78yYlBB1/Hb0ocoACd1XE4b7/J QS4XM+0Jhvk3hr+pfLt+16jG/zOrMoBID/WUAOyME77xZw7Me4mqBHlo6lu1eVItjwK2 QCLp05er9qVL1Y6Im2gEdWWQB9+gCt4YKwcN5TkYhGQfUHz6cRguURs11tNRJdYRvACb GbP16+vjewYA26edWnnWBoT7n2AxjOu2IWgLEsiMrLbmNpRivvLVDNZupU6gdVGx1UMU xugw== X-Gm-Message-State: AOAM531Ty/WgN9p7FWzO4GU9yhxhv90GBKMD79anzixTtJNGe0DgGjH3 Ap74LI0oSkWsnXk8XT+iL/Ie1QPT392/emkDnHRybVrHUwvipOnXzRejezmkXU9CtL7tROjHTyp v5KLWBDcMAjY= X-Received: by 2002:adf:fb0e:: with SMTP id c14mr483647wrr.586.1644569028310; Fri, 11 Feb 2022 00:43:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJwUBv5o6lrc5bIuyfHJC73FB/0g+al611mC6ZxwixSW6SrEZEOwJ3diZZy9JWwqLfEpAY3wKA== X-Received: by 2002:adf:fb0e:: with SMTP id c14mr483633wrr.586.1644569028116; Fri, 11 Feb 2022 00:43:48 -0800 (PST) Received: from ?IPV6:2003:cb:c70c:aa00:4cc6:d24a:90ae:8c1f? (p200300cbc70caa004cc6d24a90ae8c1f.dip0.t-ipconnect.de. [2003:cb:c70c:aa00:4cc6:d24a:90ae:8c1f]) by smtp.gmail.com with ESMTPSA id w3sm4872992wrl.113.2022.02.11.00.43.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Feb 2022 00:43:47 -0800 (PST) Message-ID: <356a4b9a-1f56-ae06-b211-bd32fc93ecda@redhat.com> Date: Fri, 11 Feb 2022 09:43:46 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 To: Mike Kravetz , linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Naoya Horiguchi , Axel Rasmussen , Mina Almasry , Michal Hocko , Peter Xu , Andrea Arcangeli , Shuah Khan , Andrew Morton References: <20220202014034.182008-1-mike.kravetz@oracle.com> <20220202014034.182008-2-mike.kravetz@oracle.com> <20571829-9d3d-0b48-817c-b6b15565f651@redhat.com> <7b174c48-d368-43ba-7eab-13719a0d15ef@oracle.com> <6a82ea68-6e1e-8f5a-ca89-6744fc896a0b@redhat.com> <55b6e78f-9594-8d5b-6ce2-bb699b9549fd@oracle.com> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH v2 1/3] mm: enable MADV_DONTNEED for hugetlb mappings In-Reply-To: <55b6e78f-9594-8d5b-6ce2-bb699b9549fd@oracle.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 5874020007 X-Stat-Signature: e6ztrdfpdmy3naax8r9znhtse5x8pbyt Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=KyeSzzpU; spf=none (imf31.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-HE-Tag: 1644569031-705293 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: >>> >>> I am now rethinking the decision to proceed with b) as described above. >>> >>> With the exception of MADV_REMOVE (which we may be able to change for >>> hugetlb), madvise operations operate on huge page size pages for hugetlb >>> mappings. If start address is in the middle of a hugetlb page, we essentially >>> align down to the beginning of the hugetlb page. If length lands in the >>> middle of a hugetlb page, we essentially round up. >> >> Which MADV calls would be affected? > > Not sure I understand the question. I was saying that madvise calls which > operate on hugetlb mappings today only operate on huge pages. So, this is > essentially align down starting address and align up end address. Let me clarify: If you accidentially MADV_NORMAL/MADV_RANDOM/MADV_SEQUENTIAL/MADV_WILLNEED a range that's slightly bigger/smaller than the requested one you don't actually care, because it will only slightly affect the performance of an application, if at all. MADV_COLD/MADV_PAGEOUT should be similar. I assume these don't apply to hugetlb at all. The effects of MADV_MERGEABLE/MADV_UNMERGEABLE/MADV_HUGEPAGE/MADV_NOHUGEPAGE should in theory be similar, however, there can be some user-space visible effects when you get it wrong. I assume these don't apply to hugetlb at all. However, for MADV_DONTNEED/MADV_REMOVE/MADV_DONTFORK/MADV_DOFORK/MADV_FREE/MADV_WIPEONFORK/MADV_KEEPONFORK/MADV_DONTDUMP/MADV_DODUMP/.... the application could easily detect the difference of the actual range handling. > For example consider the MADV_POPULATE calls you recently added. They will > only fault in huge pages in a hugetlb vma. On a related note: I don't see my man page updates upstream yet. And the last update upstream seems to have happened 5 months ago ... not sure why the man project seems to have stalled. https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/ -- Thanks, David / dhildenb