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=-2.5 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 9C051C43603 for ; Mon, 16 Dec 2019 13:37:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6A6E0206D8 for ; Mon, 16 Dec 2019 13:37:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6A6E0206D8 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 1D10E8E0008; Mon, 16 Dec 2019 08:37:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 180B98E0003; Mon, 16 Dec 2019 08:37:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 06FA08E0008; Mon, 16 Dec 2019 08:37:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0146.hostedemail.com [216.40.44.146]) by kanga.kvack.org (Postfix) with ESMTP id E672F8E0003 for ; Mon, 16 Dec 2019 08:37:14 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 97159181AC1F5 for ; Mon, 16 Dec 2019 13:37:14 +0000 (UTC) X-FDA: 76271105988.14.copy79_3f2f342528e52 X-HE-Tag: copy79_3f2f342528e52 X-Filterd-Recvd-Size: 3573 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Mon, 16 Dec 2019 13:37:14 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id t2so7306464wrr.1 for ; Mon, 16 Dec 2019 05:37:13 -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=cqmzVJtM8/ik+wTdyhfYBEe+JzF5iuu01jawnGqmvm4=; b=XpW8r6KxJCyn3K8zaqOpbm0Zff/z1Bx1ymOAbuus8KpWBKr7UFMiCEIoPuBbMOWjvk ZxVXNfzIRt4v/tNHrXseebnzSZK3tAtl3iCL3nxW67sRmp5wKTCXXItDCEx5xTtQlzOw iXeCfqeR4oFiJruaDSTqhPo/eNFfNBbFrDJ9vYdwJ7RUY0g519OCh9SgHYG2e5Y//kpc FCFTg0vvyrOzN7gZhxAl6O27MzUqZjIv1buMvnmcORtvn2i3IezF+MZrQ39CzWZbSqJU xdokUrZpuXnviduQ9+n/n18JRe4g1XdjID6ONoLlNCZDgWUwsfdSoNOO5qjfgpoSu/4j XhUg== X-Gm-Message-State: APjAAAWXe7V/OTyGyUuOJGjucujHDWmUMOHi0XVxJBfchJdigpfIosPh jIfNdlSNNeeZwptAAEw4e4SIUgRi X-Google-Smtp-Source: APXvYqw8DoZT1xy+8BNikDeso3QARwg/9LWZQz63EgJwiBZs7Ir88Njc3Qb9TIWGZJOeNYbjbrzLyA== X-Received: by 2002:adf:ee88:: with SMTP id b8mr31839416wro.249.1576503433158; Mon, 16 Dec 2019 05:37:13 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id x132sm22762701wmg.0.2019.12.16.05.37.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2019 05:37:12 -0800 (PST) Date: Mon, 16 Dec 2019 14:37:11 +0100 From: Michal Hocko To: Davidlohr Bueso Cc: Andrew Morton , Mike Kravetz , Waiman Long , 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: <20191216133711.GH30281@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191212190427.ouyohviijf5inhur@linux-p48b> 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 11:04:27, 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. I am afraid that work_struct is too large to be stuffed into the struct page array (because of the lockdep part). I think that it would be just safer to make hugetlb_lock irq safe. Are there any other locks that would require the same? -- Michal Hocko SUSE Labs