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 X-Spam-Level: X-Spam-Status: No, score=-6.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD80DC433DB for ; Tue, 2 Feb 2021 17:05:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9496B64E40 for ; Tue, 2 Feb 2021 17:05:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9496B64E40 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0C0B66B006C; Tue, 2 Feb 2021 12:05:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 096D96B0070; Tue, 2 Feb 2021 12:05:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EEEA16B0071; Tue, 2 Feb 2021 12:05:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0086.hostedemail.com [216.40.44.86]) by kanga.kvack.org (Postfix) with ESMTP id D7C716B006C for ; Tue, 2 Feb 2021 12:05:49 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id A29B8181AEF15 for ; Tue, 2 Feb 2021 17:05:49 +0000 (UTC) X-FDA: 77773954818.01.egg14_2515cf0275cc Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id BD5B210049A79 for ; Tue, 2 Feb 2021 17:05:46 +0000 (UTC) X-HE-Tag: egg14_2515cf0275cc X-Filterd-Recvd-Size: 5773 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Tue, 2 Feb 2021 17:05:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612285545; 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=v+1fcZpUJGSqPe1zl7e3r1ocOmADnUob8Rp5BHT4HHk=; b=PehCy+fyxwngH3uVpguX8RZptSKkZe4FOGJAX2dZzOklTacFYIHSQt7ksXYLCGDbyqo8Xi Qp38Spr4Hp+7+Lz2b8WdxiXxyFEc6T/9z0lvE3sdvz/RYiK5mepd/qQhnzbts8QcJem4AQ UvQ5T/E3YVaejkbG7wZtd93dukHgJK4= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-179-vKo7OdYoN4a89c22U6x8zA-1; Tue, 02 Feb 2021 12:05:41 -0500 X-MC-Unique: vKo7OdYoN4a89c22U6x8zA-1 Received: by mail-qk1-f198.google.com with SMTP id u66so17874225qkd.13 for ; Tue, 02 Feb 2021 09:05:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=v+1fcZpUJGSqPe1zl7e3r1ocOmADnUob8Rp5BHT4HHk=; b=nzGkQ/R5tc18Lu4CNqzvxAxnIohyt7YT6l92Oke1Dqland5E3+qh0zxsYdybrdIy5v bs1fWoIUV2i26I9j1aazVdb0Aw29YaZpYA4cpSsQsIVAJ4qoMlgLvklwtPvAM6j4tnet n1yiFMMLG218OJsQ12czotMknyyS2NVEyJVcHaBbOVuesNjw0PChRD/mF25CdhIbMDEW iRYtxB439bC+APEwwUmbqD0EiM6y5Yx1W6rIR7Bd2BQ8uRYrgPqrlCrxBWp9Ny5oG+Ax 6UpRK8xnn8QawJDAF7iq4FlORpdQ/XvYZt6Q39vshPQHT7EArVfVVl23qNf02CZnabe4 3hHg== X-Gm-Message-State: AOAM5327OMAMUA2mpwPO6eXiIhOBk3jTRdIVdDDTZrfoSbTVqUvSHq6r D/D6Xc0DYcEJbU1FtW1O9mZIyxzSE/r2e30ANaZET9Z3Rtbt+5LIpcwy2SpsmNbTKyaN/4yhqZF jR1v8OvopjGg= X-Received: by 2002:ac8:5c0f:: with SMTP id i15mr21179457qti.152.1612285540351; Tue, 02 Feb 2021 09:05:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJyVYvXbx1aYCp2m6Z1qjq0RDFhIwHj+UOGix7nhMTiN6DYUXpr7fokobWIsOXak0A4NmvHXZw== X-Received: by 2002:ac8:5c0f:: with SMTP id i15mr21179421qti.152.1612285540084; Tue, 02 Feb 2021 09:05:40 -0800 (PST) Received: from xz-x1 (bras-vprn-toroon474qw-lp130-20-174-93-89-182.dsl.bell.ca. [174.93.89.182]) by smtp.gmail.com with ESMTPSA id l38sm16761303qte.88.2021.02.02.09.05.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Feb 2021 09:05:39 -0800 (PST) Date: Tue, 2 Feb 2021 12:05:36 -0500 From: Peter Xu To: Jason Gunthorpe Cc: 20200918161902.GX8409@ziepe.ca, Linus Torvalds , John Hubbard , Leon Romanovsky , Linux-MM , Linux Kernel Mailing List , "Maya B . Gokhale" , Yang Shi , Marty Mcfadden , Kirill Shutemov , Oleg Nesterov , Jann Horn , Jan Kara , Kirill Tkhai , Andrea Arcangeli , Christoph Hellwig , Andrew Morton , "Zhang, Wei" Subject: Re: [PATCH 1/4] mm: Trial do_wp_page() simplification Message-ID: <20210202170536.GE6468@xz-x1> References: <27564187-4a08-f187-5a84-3df50009f6ca@amazon.com> <20210202163127.GD6468@xz-x1> <20210202164420.GL4718@ziepe.ca> MIME-Version: 1.0 In-Reply-To: <20210202164420.GL4718@ziepe.ca> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline 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 Tue, Feb 02, 2021 at 12:44:20PM -0400, Jason Gunthorpe wrote: > On Tue, Feb 02, 2021 at 11:31:27AM -0500, Peter Xu wrote: > > On Tue, Feb 02, 2021 at 04:40:33PM +0200, Gal Pressman wrote: > > > Hi Peter & Jason, > > > > Hi, Gal, Jason, > > > > > > > > It seems the hugetlb part was overlooked? > > > We're testing if the RDMA fork MADV_DONTFORK stuff can be removed on appropriate > > > kernels, but our tests still fail due to lacking explicit huge pages support [1]. > > > > I didn't think it high priority only because I think most hugetlbfs users > > should be using it shared, but maybe I'm wrong.. Then it got lost indeed. > > It turns out people are doing this: > > mmap(NULL, SEND_BUFF_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB, -1, 0) > > Which makes some sense... Yes, thanks Jason. Though my understanding is that hugetlb pages are normally reserved in production, used with careful pre-provisioning on which app would consume how much (either 2M or 1G). Such an app (especially if it forks randomly) could actually easily exaust the huge page pool. > > Gal, you could also MADV_DONTFORK this range if you are explicitly > allocating them via special mmap. Yeah I wanted to mention this one too but I just forgot when reply: the issue thread previously pasted smells like some people would like to drop MADV_DONTFORK, but if it's able to still be applied I don't know why not.. It should still be better than depending on the coming patch imho - it marks the region as "not necessary for the fork" then we skip the whole hugetlbfs chunk. It should at least be more efficient if applicable. Thanks, -- Peter Xu