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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7030FC433EF for ; Mon, 11 Apr 2022 14:44:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343789AbiDKOqi (ORCPT ); Mon, 11 Apr 2022 10:46:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344434AbiDKOqf (ORCPT ); Mon, 11 Apr 2022 10:46:35 -0400 X-Greylist: delayed 2611 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 11 Apr 2022 07:44:18 PDT Received: from out162-62-57-210.mail.qq.com (out162-62-57-210.mail.qq.com [162.62.57.210]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5456662CA for ; Mon, 11 Apr 2022 07:44:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1649688253; bh=7GopoeoK8zI4GB2l2eUN6bBtjkL/7R2gwbjUIUdvthE=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=eW0xstcWUyT4B9NM20y9wT/R8QwUbOSYT12qUzbcidpHB88jhMuili6sd3tHDYBLu aEiTf0MP0DGz/NcR+RcAmeWEO+ykBdqCiDmT1KRD5ivDQIQh3/fa+cn8e1Ld31L1g4 BYWS1a37n6HQTtjc7ufU4bm+8droRJbAhUYkzFdE= Received: from [192.168.0.110] ([36.57.147.99]) by newxmesmtplogicsvrsza9.qq.com (NewEsmtp) with SMTP id B092E6BD; Mon, 11 Apr 2022 22:44:09 +0800 X-QQ-mid: xmsmtpt1649688249tqqsw39z6 Message-ID: X-QQ-XMAILINFO: OUk+E8Vw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: Assign a PASID to mm on PASID allocation and free it on mm exit To: Dave Hansen , Joerg Roedel , Fenghua Yu , jean-philippe Cc: Ravi V Shankar , Tony Luck , Ashok Raj , Peter Zijlstra , Dave Hansen , x86 , linux-kernel , iommu , Ingo Molnar , Borislav Petkov , Andy Lutomirski , Josh Poimboeuf , Thomas Gleixner References: <20220207230254.3342514-1-fenghua.yu@intel.com> <20220207230254.3342514-6-fenghua.yu@intel.com> <56ed509d-a7cf-1fde-676c-a28eb204989b@intel.com> From: "zhangfei.gao@foxmail.com" X-OQ-MSGID: <88055f44-3106-feca-aeac-d7272f3ee824@foxmail.com> Date: Mon, 11 Apr 2022 22:44:08 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/4/11 下午10:36, Dave Hansen wrote: > On 4/11/22 07:20, zhangfei.gao@foxmail.com wrote: >>> Is there nothing before this call trace?  Usually there will be at least >>> some warning text. >> I added dump_stack() in ioasid_free. > Hold on a sec, though... > > What's the *problem* here? Did something break or are you just saying > that something looks weird to _you_? After this, nginx is not working at all, and hardware reports error. Suppose the the master use the ioasid for init, but got freed. hardware reports: [  152.731869] hisi_sec2 0000:76:00.0: qm_acc_do_task_timeout [error status=0x20] found [  152.739657] hisi_sec2 0000:76:00.0: qm_acc_wb_not_ready_timeout [error status=0x40] found [  152.747877] hisi_sec2 0000:76:00.0: sec_fsm_hbeat_rint [error status=0x20] found [  152.755340] hisi_sec2 0000:76:00.0: Controller resetting... [  152.762044] hisi_sec2 0000:76:00.0: QM mailbox operation timeout! [  152.768198] hisi_sec2 0000:76:00.0: Failed to dump sqc! [  152.773490] hisi_sec2 0000:76:00.0: Failed to drain out data for stopping! [  152.781426] hisi_sec2 0000:76:00.0: QM mailbox is busy to start! [  152.787468] hisi_sec2 0000:76:00.0: Failed to dump sqc! [  152.792753] hisi_sec2 0000:76:00.0: Failed to drain out data for stopping! [  152.800685] hisi_sec2 0000:76:00.0: QM mailbox is busy to start! [  152.806730] hisi_sec2 0000:76:00.0: Failed to dump sqc! [  152.812017] hisi_sec2 0000:76:00.0: Failed to drain out data for stopping! [  152.819946] hisi_sec2 0000:76:00.0: QM mailbox is busy to start! [  152.825992] hisi_sec2 0000:76:00.0: Failed to dump sqc! Thanks > > For instance, if we have: > > nginx: ioasid_alloc()==1 > fork(); // spawn the daemon > exit(); > ioasid_free(1); > > and then a moment later: > > lynx: ioasid_alloc()==1 > fork(); > exit(); > ioasid_free(1); > > There's no problem. The original nginx process with ioasid==1 exited. > The fact that *some* process called nginx is still running doesn't mean > that it still has a reference to asid==1. > > Are you sure the nginx process that allocated the ASID is the same > process you see in ps?