Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3489414pxf; Mon, 22 Mar 2021 07:37:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRInLRORPzBJkzV57QsGt/Xti5OiAq77oHaUjsW1yGqdZqZ6LpHcRE8fesAJs6NKvewfLZ X-Received: by 2002:aa7:c346:: with SMTP id j6mr26128051edr.386.1616423836664; Mon, 22 Mar 2021 07:37:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616423836; cv=none; d=google.com; s=arc-20160816; b=zHjAIdUv6tfZps6tHvRlEQSPmg0l9jwvuePSQl9ssconQGAVncDjsXhCzfvakUJDNS lsXY8ocGYmGRpRZGdAXKfgVN4mvEJrKtmyVrD6s3GzHyoamukfEtkEmXkfr7BG4TK1Cu vgJ3H1B/npt90oZRYtZorS0M5S2GMa6pipHePjNRotIz8Rwj0pdaQa/U6OX8Fccv8Lpc aPbBMVMkDFzQS1lE+Y0Zf3yNNQvZSx8RrIlHq+Wkjpkyf86gO2TlcGz0VfYSZirYO/CM 4HUri0/Rwk0zgSYsUYoCjP5wpEYFWKq+MTi++Kzl/V1TiAG5Q1Iqs302qd4uW9Coud1G 21UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ka7o8YzjuihRvqSaAHVBlNM4iZuzXnEWVNYaDHEt30s=; b=v+S5WSgEqzcL2MTIe1c1XgFF6YNdiVgQprIuB64vf0MB13bfqwykecoOm7SjusTUSg KiHvaOvkfijg34o6Iwwhf7byoGcgtV8jNVsGELXN7bc207gdUtFdijnHCWIb3yNPUSAh 89IvyWaMNOnqToLiH3N5laKO6hWjbaqUO3F+mwLTLOfBSiu++iHcIzxJVOnwRkAWWmZG 1+AttNmwSWJDdIhcx/+STLsk3csNfKexOPVUFKR2XUz+HD+pO2La3O4zUkXPZFXnpHf6 5aq5SpsLBZ1Nf2CMvDjd4ncqFy7gCCptgSa3mHCn9amYpuf/aTGMe1kr5afuqNrwW5aX fjnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=GsJ4VZ8c; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q25si11649082edt.39.2021.03.22.07.36.53; Mon, 22 Mar 2021 07:37:16 -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=@suse.com header.s=susede1 header.b=GsJ4VZ8c; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230039AbhCVOf6 (ORCPT + 99 others); Mon, 22 Mar 2021 10:35:58 -0400 Received: from mx2.suse.de ([195.135.220.15]:40490 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229771AbhCVOf1 (ORCPT ); Mon, 22 Mar 2021 10:35:27 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1616423726; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ka7o8YzjuihRvqSaAHVBlNM4iZuzXnEWVNYaDHEt30s=; b=GsJ4VZ8ch9CqRDYUamqSvXfTADUchqiUp0ZGbfgY38XyC6G9M+qr/s72nDN88PGa3HNYR5 7K9yw3l9nCL2UkCkB2dK+T9geEcMlPuaheGoomXCXjb6umrBmsz6YGbL4+0+Qm81qfsAWY 9Hw3Jxm9ZX6Z1dMYd20+UqMQKMlqksc= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id EB4A5AC1F; Mon, 22 Mar 2021 14:35:25 +0000 (UTC) Date: Mon, 22 Mar 2021 15:35:25 +0100 From: Michal Hocko To: Mike Kravetz Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Shakeel Butt , Oscar Salvador , David Hildenbrand , Muchun Song , David Rientjes , Miaohe Lin , Peter Zijlstra , Matthew Wilcox , HORIGUCHI NAOYA , "Aneesh Kumar K . V" , Waiman Long , Peter Xu , Mina Almasry , Andrew Morton Subject: Re: [RFC PATCH 6/8] hugetlb: make free_huge_page irq safe Message-ID: References: <20210319224209.150047-1-mike.kravetz@oracle.com> <20210319224209.150047-7-mike.kravetz@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210319224209.150047-7-mike.kravetz@oracle.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 19-03-21 15:42:07, Mike Kravetz wrote: > Commit c77c0a8ac4c5 ("mm/hugetlb: defer freeing of huge pages if in > non-task context") was added to address the issue of free_huge_page > being called from irq context. That commit hands off free_huge_page > processing to a workqueue if !in_task. However, as seen in [1] this > does not cover all cases. Instead, make the locks taken in the > free_huge_page irq safe. > > This patch does the following: > - Make hugetlb_lock irq safe. This is mostly a simple process of > changing spin_*lock calls to spin_*lock_irq* calls. > - Make subpool lock irq safe in a similar manner. > - Revert the !in_task check and workqueue handoff. This is not sufficient (and 0day bot has captured that already). You cannot call update_and_free_page from the same context. -- Michal Hocko SUSE Labs