Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp109534ybt; Thu, 25 Jun 2020 16:40:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7oauCgVGXuk4OWX9yXZQXlf4vWGeh1StACDnvnMikcy9Tp7o5bRgMSCM428wQ8BMceGJg X-Received: by 2002:aa7:c69a:: with SMTP id n26mr702922edq.2.1593128438985; Thu, 25 Jun 2020 16:40:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593128438; cv=none; d=google.com; s=arc-20160816; b=0SDQeVTnz6zJHDT0CPQJX/e/B9lpi6InfNZlQNhDhoKyfm24JMZ8udrg5LpDbodDq1 IFjaQilGp/a96CbUGDAc66DIRN1zQCkJB6zcWwi1JmOQB6VH671w/vMUgAHmhpdD3Vaa 78O22x1nAdZ7+Yw4fRWqe+aGVty5f1kBIYJ4ctgbY6m4wn/Y+daYf1R6I2w1YRsG1qy7 m/iskvZ9GwKEvc4uCdKv40p7quSKoJaQXAh5/PlfoztE+qWLCJSyrZKyV9nIZj2tkVJz k0Mf+rpvn9Ua8+y+J3ruinf40Z2K48wbXgD8/wQMQkrtZ7eINwcpa+FcCtyxFPgteznU 6HbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:dkim-signature; bh=krpcMCcVgqrHU4DozYxPJLFrcQvFdH0H3fHWBcByblE=; b=UW74SotqskmLJ1nUmjTTJQ7h6DhzoXfIoBFNXw+wUqDxfmqHebRm3pt00qGhrLsica D5ru3xj52bMsrt8nVy0sOJTbggi4sFB7uO2FxHlpmJ+qnosbD1RVSNZIlSfpByJAvDm4 8BIABPIIllPK/bHB9EwcfFJtn2w4y7+wQkRh7ZJYrb2kNNvY/g8NoUB9cy9X5MpGuQG+ TRNTVFl1rGjweb71KatqaLSH6SWTemwAHGDXlnW/TpNHVWGslMQCe7IPeFC7uGy6gV66 9rZzb5hP5KcJu/NH8ffSQRpPq2ApZmyB27e4LccXkSJDNbxRHVEUpVfOwerRueIDSWnF 1f5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=g4OfPnHj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sd15si393536ejb.606.2020.06.25.16.40.15; Thu, 25 Jun 2020 16:40:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=g4OfPnHj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2407217AbgFYVdv (ORCPT + 99 others); Thu, 25 Jun 2020 17:33:51 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:54518 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406463AbgFYVdu (ORCPT ); Thu, 25 Jun 2020 17:33:50 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 05PLM3P7123610; Thu, 25 Jun 2020 21:33:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : references : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=krpcMCcVgqrHU4DozYxPJLFrcQvFdH0H3fHWBcByblE=; b=g4OfPnHj6bPVjnXho9D/R/RyP2UU9IDVzUcHKfYUgXzeKXJBuR0YOOtp2ttdv6OC9dzl XGct37bY4u4DNRRpgtxk8QOPEo1a3mP0eb3f/POW7REAr0e6TCX5/qh0sEc1CNsU4ssJ 9w38Go2idTL7G0ZncmJ4CuNw17E2N0s4OErjGCpi/eQt2dIfvL6sAmqX1QBdk2oXJmXD U/3B+dQ0b39oHzQZAovsHaYiZF0ZuA8SAT/gjpyFKKVOU8ki93aVNuuwVfJYNY9GXS2s JOO4/wOc0tO+2RzJzBHE1mUPeXihr468ZI+/deg5l7WaEXmxw8r+QZul3/t0cbsSlcCL VQ== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 31uusu2yaj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 25 Jun 2020 21:33:33 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 05PLO10Z092210; Thu, 25 Jun 2020 21:33:33 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3030.oracle.com with ESMTP id 31uur1tdch-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 25 Jun 2020 21:33:33 +0000 Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 05PLXUX9018695; Thu, 25 Jun 2020 21:33:30 GMT Received: from [192.168.2.112] (/50.38.35.18) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 25 Jun 2020 21:33:30 +0000 Subject: Re: [hugetlbfs] c0d0381ade: vm-scalability.throughput -33.4% regression From: Mike Kravetz To: kernel test robot Cc: Linus Torvalds , Andrew Morton , Michal Hocko , Hugh Dickins , Naoya Horiguchi , "Aneesh Kumar K.V" , Andrea Arcangeli , "Kirill A.Shutemov" , Davidlohr Bueso , Prakash Sangappa , LKML , lkp@lists.01.org References: <20200622005551.GK5535@shao2-debian> Message-ID: <718e1653-b273-096b-0ee3-f720cf794612@oracle.com> Date: Thu, 25 Jun 2020 14:33:28 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9663 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxlogscore=999 adultscore=0 mlxscore=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006250125 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9663 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 bulkscore=0 cotscore=-2147483648 malwarescore=0 mlxscore=0 clxscore=1015 lowpriorityscore=0 mlxlogscore=999 phishscore=0 priorityscore=1501 spamscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006250125 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/22/20 3:01 PM, Mike Kravetz wrote: > On 6/21/20 5:55 PM, kernel test robot wrote: >> Greeting, >> >> FYI, we noticed a -33.4% regression of vm-scalability.throughput due to commit: >> >> >> commit: c0d0381ade79885c04a04c303284b040616b116e ("hugetlbfs: use i_mmap_rwsem for more pmd sharing synchronization") >> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master >> >> in testcase: vm-scalability >> on test machine: 288 threads Intel(R) Xeon Phi(TM) CPU 7295 @ 1.50GHz with 80G memory >> with following parameters: >> >> runtime: 300s >> size: 8T >> test: anon-cow-seq-hugetlb >> cpufreq_governor: performance >> ucode: 0x11 >> > > Some performance regression is not surprising as the change includes acquiring > and holding the i_mmap_rwsem (in read mode) during hugetlb page faults. 33.4% > seems a bit high. But, the test is primarily exercising the hugetlb page > fault path and little else. > > The reason for taking the i_mmap_rwsem is to prevent PMD unsharing from > invalidating the pmd we are operating on. This specific test case is operating > on anonymous private mappings. So, PMD sharing is not possible and we can > eliminate acquiring the mutex in this case. In fact, we should check all > mappings (even sharable) for the possibly of PMD sharing and only take the > mutex if necessary. It will make the code a bit uglier, but will take care > of some of these regressions. We still need to take the mutex in the case > of PMD sharing. I'm afraid a regression is unavoidable in that case. > > I'll put together a patch. Not acquiring the mutex on faults when sharing is not possible is quite straight forward. We can even use the existing routine vma_shareable() to easily check. However, the next patch in the series 87bf91d39bb5 "hugetlbfs: Use i_mmap_rwsem to address page fault/truncate race" depends on always acquiring the mutex. If we break this assumption, then the code to back out hugetlb reservations needs to be written. A high level view of what needs to be done is in the commit message for 87bf91d39bb5. I'm working on the code to back out reservations. -- Mike Kravetz