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=-5.5 required=3.0 tests=MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 6ABE5C43603 for ; Mon, 16 Dec 2019 13:27:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 35782206D8 for ; Mon, 16 Dec 2019 13:27:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 35782206D8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A3CEB8E0008; Mon, 16 Dec 2019 08:27:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9C5A38E0003; Mon, 16 Dec 2019 08:27:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8DC348E0008; Mon, 16 Dec 2019 08:27:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0250.hostedemail.com [216.40.44.250]) by kanga.kvack.org (Postfix) with ESMTP id 778EE8E0003 for ; Mon, 16 Dec 2019 08:27:01 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 273C78249980 for ; Mon, 16 Dec 2019 13:27:01 +0000 (UTC) X-FDA: 76271080242.15.eye07_7771a5fd3ff01 X-HE-Tag: eye07_7771a5fd3ff01 X-Filterd-Recvd-Size: 4364 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Mon, 16 Dec 2019 13:27:00 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id z3so7253643wru.3 for ; Mon, 16 Dec 2019 05:27:00 -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:user-agent; bh=/uIa6qWlTFo90l2lpEZAt0MQFqChyxhRzpPtTSYXp4U=; b=fSIUPciv5XqTu+HYUaHvblLI7vBUeOFdNkivv6fxQQOw5ej2CviKoG/i/+LYj/blJ1 M9T2CbeYJjH4MwJbYvfMQOQNMa5hDIpq7fsHzO2S1Cu+c0pKJ6GcorLrDFeK3gtcndp6 4zHkY2vv21zYz4E64EqlPAyDZLJW7DHreURG3xXUXbK4msmkGtAocqhhK7J6U1UpQMK4 Lia8Jo/7LWoV6gIT5VB/ybogEAXYhdOFnCU1AaeHzkmfsxmsRUDiW0tvCxAqPTQrJBgk 8l7DPL4tqsBuxaj9fxaU3xf/a+jLvnd0y77BuczITwP9dJCtc7q5FewbXIGmwVlMhPl4 0Wkw== X-Gm-Message-State: APjAAAUuLM2kCDYqNcSKUOqt2xNv1OCznwRSJzaPmiDJR9q2CpPlkzRb c6m0CybbT2Sdi8bidHUSFtY= X-Google-Smtp-Source: APXvYqwnhYWJEhw+ULTW9reda6U0/VuF01asXaxwkhWlolBkdgoO1MteBuEjrxsO3bJo2EZR/Or9Xw== X-Received: by 2002:adf:dfc1:: with SMTP id q1mr29905382wrn.155.1576502819684; Mon, 16 Dec 2019 05:26:59 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id f1sm21415912wro.85.2019.12.16.05.26.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2019 05:26:58 -0800 (PST) Date: Mon, 16 Dec 2019 14:26:58 +0100 From: Michal Hocko To: Waiman Long Cc: Mike Kravetz , Andrew Morton , Matthew Wilcox , linux-kernel@vger.kernel.org, linux-mm@kvack.org, aneesh.kumar@linux.ibm.com Subject: Re: [PATCH v2] mm/hugetlb: defer free_huge_page() to a workqueue Message-ID: <20191216132658.GG30281@dhcp22.suse.cz> References: <20191211194615.18502-1-longman@redhat.com> <4fbc39a9-2c9c-4c2c-2b13-a548afe6083c@oracle.com> <32d2d4f2-83b9-2e40-05e2-71cd07e01b80@redhat.com> <0fcce71f-bc20-0ea3-b075-46592c8d533d@oracle.com> <20191212060650.ftqq27ftutxpc5hq@linux-p48b> <20191212063050.ufrpij6s6jkv7g7j@linux-p48b> <20191212190427.ouyohviijf5inhur@linux-p48b> <79d3a7e1-384b-b759-cd84-56253fb9ed40@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <79d3a7e1-384b-b759-cd84-56253fb9ed40@redhat.com> User-Agent: Mutt/1.12.2 (2019-09-21) 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 Thu 12-12-19 15:52:20, Waiman Long wrote: > On 12/12/19 2:22 PM, Mike Kravetz wrote: > > On 12/12/19 11:04 AM, Davidlohr Bueso wrote: > >> There have been deadlock reports[1, 2] where put_page is called > >> from softirq context and this causes trouble with the hugetlb_lock, > >> as well as potentially the subpool lock. > >> > >> For such an unlikely scenario, lets not add irq dancing overhead > >> to the lock+unlock operations, which could incur in expensive > >> instruction dependencies, particularly when considering hard-irq > >> safety. For example PUSHF+POPF on x86. > >> > >> Instead, just use a workqueue and do the free_huge_page() in regular > >> task context. > >> > >> [1] https://lore.kernel.org/lkml/20191211194615.18502-1-longman@redhat.com/ > >> [2] https://lore.kernel.org/lkml/20180905112341.21355-1-aneesh.kumar@linux.ibm.com/ > >> > >> Reported-by: Waiman Long > >> Reported-by: Aneesh Kumar K.V > >> Signed-off-by: Davidlohr Bueso > > Thank you Davidlohr. > > > > The patch does seem fairly simple and straight forward. I need to brush up > > on my workqueue knowledge to provide a full review. > > > > Longman, > > Do you have a test to reproduce the issue? If so, can you try running with > > this patch. > > Yes, I do have a test that can reproduce the issue. I will run it with > the patch and report the status tomorrow. Can you extract guts of the testcase and integrate them into hugetlb test suite? -- Michal Hocko SUSE Labs