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=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 40EFCC433F5 for ; Thu, 6 Sep 2018 03:55:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DEDB72075E for ; Thu, 6 Sep 2018 03:55:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DEDB72075E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726425AbeIFI25 (ORCPT ); Thu, 6 Sep 2018 04:28:57 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:35898 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725804AbeIFI24 (ORCPT ); Thu, 6 Sep 2018 04:28:56 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w863tWIw010473 for ; Wed, 5 Sep 2018 23:55:33 -0400 Received: from e36.co.us.ibm.com (e36.co.us.ibm.com [32.97.110.154]) by mx0a-001b2d01.pphosted.com with ESMTP id 2masqnwww2-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 05 Sep 2018 23:55:32 -0400 Received: from localhost by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 5 Sep 2018 21:54:25 -0600 Received: from b03cxnp07029.gho.boulder.ibm.com (9.17.130.16) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 5 Sep 2018 21:54:21 -0600 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w863sLfM49676398 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 5 Sep 2018 20:54:21 -0700 Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 081BD7805F; Wed, 5 Sep 2018 21:54:21 -0600 (MDT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 192367805C; Wed, 5 Sep 2018 21:54:19 -0600 (MDT) Received: from [9.102.0.183] (unknown [9.102.0.183]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 5 Sep 2018 21:54:18 -0600 (MDT) Subject: Re: [RFC PATCH] mm/hugetlb: make hugetlb_lock irq safe To: Andrew Morton , Matthew Wilcox Cc: Mike Kravetz , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20180905112341.21355-1-aneesh.kumar@linux.ibm.com> <20180905130440.GA3729@bombadil.infradead.org> <20180905134848.GB3729@bombadil.infradead.org> <20180905125846.eb0a9ed907b293c1b4c23c23@linux-foundation.org> From: "Aneesh Kumar K.V" Date: Thu, 6 Sep 2018 09:24:17 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180905125846.eb0a9ed907b293c1b4c23c23@linux-foundation.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 18090603-0020-0000-0000-00000E5F5786 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009676; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01084190; UDB=6.00559573; IPR=6.00864189; MB=3.00023137; MTD=3.00000008; XFM=3.00000015; UTC=2018-09-06 03:54:23 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18090603-0021-0000-0000-000062EE143D Message-Id: <19bb32a4-7acc-29ea-c00c-65cd2ebf9878@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-09-06_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=549 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809060041 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/06/2018 01:28 AM, Andrew Morton wrote: > On Wed, 5 Sep 2018 06:48:48 -0700 Matthew Wilcox wrote: > >>> I didn't. The reason I looked at current patch is to enable the usage of >>> put_page() from irq context. We do allow that for non hugetlb pages. So was >>> not sure adding that additional restriction for hugetlb >>> is really needed. Further the conversion to irqsave/irqrestore was >>> straightforward. >> >> straightforward, sure. but is it the right thing to do? do we want to >> be able to put_page() a hugetlb page from hardirq context? > > Calling put_page() against a huge page from hardirq seems like the > right thing to do - even if it's rare now, it will presumably become > more common as the hugepage virus spreads further across the kernel. > And the present asymmetry is quite a wart. > > That being said, arch/powerpc/mm/mmu_context_iommu.c:mm_iommu_free() is > the only known site which does this (yes?) so perhaps we could put some > stopgap workaround into that site and add a runtime warning into the > put_page() code somewhere to detect puttage of huge pages from hardirq > and softirq contexts. > > And attention will need to be paid to -stable backporting. How long > has mm_iommu_free() existed, and been doing this? > That is old code that goes back to v4.2 ( 15b244a88e1b2895605be4300b40b575345bcf50) -aneesh