Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2377090rdb; Thu, 21 Sep 2023 17:42:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHtjeJ8obpPKHg+pTlDui+3KH7TW4a7OcAMd8E2kmp3nbzYxWTlCn/d3upo8qu65zqI/VbS X-Received: by 2002:a05:6358:9206:b0:13a:d25a:ed7b with SMTP id d6-20020a056358920600b0013ad25aed7bmr9167470rwb.10.1695343343742; Thu, 21 Sep 2023 17:42:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695343343; cv=none; d=google.com; s=arc-20160816; b=n7tOtO3W4aKmLD3W7W2lS5bTtpH6uPpZbNDev4oa3qfY88X7h2RIvT9Ly/J6Mi/ii1 Xm01X7Ip9lD43ryJ7UFpjfPN46oXDhZVQSFDKrioIZplFmgAP/3WCmmUTONzg8ufBopy /KrbwxhmW51J4XPfRkajOJKED18hB6R6HDZrh2+9FJ3Aq7qwAMzbsUYLiy4syQ1ZwAj8 JjcP/gE/60a1NIPj2ToaAwWZzh4+lndJ9fSmN6OgJgnFoAoFTA622/UeRMcfnHtjEo9G nmLj4QZv67Ej49+X0wHQMBpGnoMJ7LjT2P3HVrqFQnai3qC/CjftY+l7l1kITI/UQZmh Yegg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=41US36AAbe1uf9Wn2BKB3yN0AuZDP2e7zKqqW39eWaM=; fh=ZLs516Y7qoeT1dAXXeKtHGrayYcnyccj53JY1CFyOaw=; b=XNK+1NyRD85qeFMxhcYjV2NsHF3De4DaWmdgrO+UlohAYyJUvXEs28r74YsCv2le7n sDLLdIZMzKDsZkrzQ3NUFSbRboeC/pG1lHiUUMAaIY0SlJjq8AL4V3FntvpGBxB6UP/V qdDNOhC97igm5+7AR/oSulnjz2rVCMnBD4morF0eEttpdNLDOO7DIZwXDrUptiLnCmZF /k/7BFNo2Uu4vJTaOebWbZCwnA6t7n2GJQcmohSPdyl++oCYf0V6O9oo1ie90iIJUEOa jowFdJ9I2D0G5Aq6AyPiwszq0fFLsIKZ7JBCwEsaWfQa5kHbmtwH4X3pe1UIVfQzNh4H qzSw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id k33-20020a634b61000000b00578aa7b05b5si2603590pgl.742.2023.09.21.17.42.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 17:42:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 790C781906A1; Thu, 21 Sep 2023 17:37:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229590AbjIVAhe convert rfc822-to-8bit (ORCPT + 99 others); Thu, 21 Sep 2023 20:37:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbjIVAhd (ORCPT ); Thu, 21 Sep 2023 20:37:33 -0400 Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14C81F5 for ; Thu, 21 Sep 2023 17:37:26 -0700 (PDT) Received: from imladris.home.surriel.com ([10.0.13.28] helo=imladris.surriel.com) by shelob.surriel.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qjUAJ-0008Jc-2d; Thu, 21 Sep 2023 20:37:03 -0400 Message-ID: <42128925a9c36e7bc9d55ca422e36ff880999087.camel@surriel.com> Subject: Re: [PATCH 1/2] hugetlbfs: extend hugetlb_vma_lock to private VMAs From: Rik van Riel To: Mike Kravetz Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com, linux-mm@kvack.org, akpm@linux-foundation.org, muchun.song@linux.dev, leit@meta.com Date: Thu, 21 Sep 2023 20:37:03 -0400 In-Reply-To: <20230921224201.GB21193@monkey> References: <20230920021811.3095089-1-riel@surriel.com> <20230920021811.3095089-2-riel@surriel.com> <20230921224201.GB21193@monkey> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 Sender: riel@surriel.com X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 21 Sep 2023 17:37:33 -0700 (PDT) On Thu, 2023-09-21 at 15:42 -0700, Mike Kravetz wrote: > On 09/19/23 22:16, riel@surriel.com wrote: > > From: Rik van Riel > > > > Extend the locking scheme used to protect shared hugetlb mappings > > from truncate vs page fault races, in order to protect private > > hugetlb mappings (with resv_map) against MADV_DONTNEED. > > > > Add a read-write semaphore to the resv_map data structure, and > > use that from the hugetlb_vma_(un)lock_* functions, in preparation > > for closing the race between MADV_DONTNEED and page faults. > > > > Signed-off-by: Rik van Riel > > --- > >  include/linux/hugetlb.h |  6 ++++++ > >  mm/hugetlb.c            | 36 ++++++++++++++++++++++++++++++++---- > >  2 files changed, 38 insertions(+), 4 deletions(-) > > This looks straight forward. > > However, I ran just this patch through libhugetlbfs test suite and it > hung on > misaligned_offset (2M: 32). > https://github.com/libhugetlbfs/libhugetlbfs/blob/master/tests/misaligned_offset.c Ah, so that's why I couldn't find hugetlbfs tests in the kernel selftests directory. They're in libhugetlbfs. I'll play around with those tests tomorrow. Let me see what's going on. -- All Rights Reversed.