Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp131395ybl; Thu, 12 Dec 2019 15:20:13 -0800 (PST) X-Google-Smtp-Source: APXvYqz0tWmnxRqF+/DrKvtMHA8VVyN1WWbcQZr+BkOLsJNibstPPiWDnX0VSC5meyrBKo3EAMo1 X-Received: by 2002:a05:6830:611:: with SMTP id w17mr11208128oti.191.1576192813272; Thu, 12 Dec 2019 15:20:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576192813; cv=none; d=google.com; s=arc-20160816; b=0LW7J40Ugj3uqLL8Bz9TFtmVFRiPKyDuH49gwDxLBontFoRx7thfEjuv4R2OsDM0i9 if5zNo3qu7G3BMv5ikVkOXyqIMEKVLPhCR1WHpJdmm1xpEsP8rigWHeHKhFJPstgu4WF sQ4fXBphyBmhE9ctT+jZBjOfAA/yUGc/9DKoh5iNX3omTWeAECKTCG43bZNaSyQEqc+q f0+3cvtvzSYdpkyz/sONq4JkN5rbf7K/ETTZWbcOMl3wz5q27zYBkWGbi2nFzz48Lams jvRoKYKmus2ABmuw4vptrHANTr/fg2H9qCVYQH9muavAgmdijFFtemRH25hBSQrecAoM dwrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date; bh=qyhrGo2KA02uqLZeusK0A+7eweNKnMfTjnWUnKNfiUs=; b=vRfeX3EsxbID45p+d0vGCN5bwsAWqAmdG+nPQCRnDQqgg6E96vJMmZNaXfcb9C96Oi zF10vHIl4vA1Rih1DZyBLuHJBvCx0o1nL0SoBVyZTAKcxPZBTKBe8MEM0ns9Hxkz7ZJl X4TXZaZYKTmQg1zOI3fERpqFU9ame3q9ClA/jLiyYjd5f774dpWdcAiwLGhwu08TbNWN 0ReOtcOw/u12tUXMLkYmU2/MW7mZLn2TvTWCdHy37O8kpFb/coLql0qZM2VI0qFZn/EJ PCJFbP+6kpG18vAPW2euNxlt9M0EfsuKXo2yg/vHRJjlAkRTOawgWCTOiqOUBKnzES+C 5G9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m4si3963939otn.281.2019.12.12.15.20.00; Thu, 12 Dec 2019 15:20:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731118AbfLLWtN (ORCPT + 99 others); Thu, 12 Dec 2019 17:49:13 -0500 Received: from mx2.suse.de ([195.135.220.15]:38150 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730707AbfLLWtN (ORCPT ); Thu, 12 Dec 2019 17:49:13 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 7C129AB71; Thu, 12 Dec 2019 22:49:11 +0000 (UTC) Date: Thu, 12 Dec 2019 14:42:44 -0800 From: Davidlohr Bueso To: Andi Kleen Cc: Mike Kravetz , Waiman Long , Matthew Wilcox , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Michal Hocko Subject: Re: [PATCH v2] hugetlbfs: Disable softIRQ when taking hugetlb_lock Message-ID: <20191212224244.ohfcrvnuc7euzmzw@linux-p48b> Mail-Followup-To: Andi Kleen , Mike Kravetz , Waiman Long , Matthew Wilcox , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Michal Hocko 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> <871rt99qmg.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <871rt99qmg.fsf@linux.intel.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 12 Dec 2019, Andi Kleen wrote: >Davidlohr Bueso writes: >> +void free_huge_page(struct page *page) >> +{ >> + struct hugetlb_free_page_work work; >> + >> + work.page = page; >> + INIT_WORK_ONSTACK(&work.work, free_huge_page_workfn); >> + queue_work(hugetlb_free_page_wq, &work.work); >> + >> + /* >> + * Wait until free_huge_page is done. >> + */ >> + flush_work(&work.work); >> + destroy_work_on_stack(&work.work); > >Does flushing really work in softirq context? > >Anyways, waiting seems inefficient over fire'n'forget Yep. I was only thinking about the workerfn not blocking and therefore we could wait safely, but flush_work has no such guarantees. Thanks, Davidlohr