Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp768228pxb; Tue, 12 Apr 2022 12:58:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyu0hmxqTh7wsbCzKC1vrwm0ItFzGJuXlNx6WbtJCq7rHdbb94YRrEPKVC3eYi/REmXZlm3 X-Received: by 2002:a17:902:a988:b0:158:9877:6c2c with SMTP id bh8-20020a170902a98800b0015898776c2cmr1901780plb.80.1649793496627; Tue, 12 Apr 2022 12:58:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649793496; cv=none; d=google.com; s=arc-20160816; b=CegLJ9DcWDQhz/H5GaO3Semcu8B37REie1KS4DfdPAAbKG7n5+ZlMVbQUQ2pGXzcmV QU8SGhwRWaBVbLO1VqHAlbiYFjVnR1tRObsgnwHcWvLDugtJfKanPM8NlnS2D2Bnp05M qq8CT0w1Cz1ZeUQDvLdIGJbip6T8AH6wV3aAaeNTq9oqH3A0F/oIixR0o6tToglnt/r8 9iEJJJOmx4Raz0JKbXmwqZwZACrxEaYTQlck60fGIHApnwy86LYhuWquhW1NIg2wzdcD p+dHHKTIPsNQKtDoyT8etj5o4zeF3m44O/D4nnPQCPBBpoI3DcbgG5ERxO64X6HmZUvb 6EkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=2zv999YlJLrRTX4LMjarJiv9EJDLp0Oa2+WM1FawTRk=; b=YgLEriH8QhFJ0sJhOohuNBsTpsU0DauKooIIRGOoJp9mShnERVJHMFv5fiwOUBvptR HdLIqZdWS2puMHEvWlnUwikpdU3+wM3WxZ4eDxm4Nz1RQWVU5PsA0eGzFmyFH51bE0iH HFVuF6KRF9mS4JvNPAdCIcqt4NC/gj1mFHG0IdEanjzI0gWsiVjwohBq44CiitDuRdEv SRbP0pXbPvsLMK6xoiLuPwzohK7n+17qsp9TMzBNjMVVrrdnwglfK29WOBPtuj8/Q5q+ jE4d5+VmaUaCWVpgeqSn6woTA6aUBfzUEnIxr5CbXsvsUOJ9r7BC7CsQRbZVtvT7fuMU hnHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DH4cwhys; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id t16-20020a639550000000b003816043efeesi3316636pgn.483.2022.04.12.12.58.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 12:58:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DH4cwhys; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2515074869; Tue, 12 Apr 2022 12:51:28 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241690AbiDKOij (ORCPT + 99 others); Mon, 11 Apr 2022 10:38:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241191AbiDKOii (ORCPT ); Mon, 11 Apr 2022 10:38:38 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05A78288 for ; Mon, 11 Apr 2022 07:36:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649687783; x=1681223783; h=message-id:date:mime-version:to:cc:references:from: subject:in-reply-to:content-transfer-encoding; bh=YZSVAZRsUUEFlaaidv4vr1KoJx4NYOFjDRgt6QosIts=; b=DH4cwhyshuDne3i0nvCFEM9oMF+l1AFwVvYfax1FTCjHd5fEC5wN8kSV avJxhFo8vRMCEQtU1uM0pN6hd4NhygArVSlHHOs81/t168HSAJMXbUzBz MqS7M9n2U7BOVgLzYKqi1M1tl05iI92mptiGJajzP2a7n7OivDKaRAAFu KGzk7IcuAs5OLFKyP9AzVkS/50zp8hLTPezZxE4t4cqbUT6Z9oEfc/ViA KLGMRzsShXH4ceD5ZjC5AidUdIVQWHjQ8LlNk61sJfRzKXeng6HYEGtvI Td4Lty2u7sHy9nQXGU55OjNKR6Sazg7okRIdpbVoEoO1wXWhODX18ZevZ Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10314"; a="287138868" X-IronPort-AV: E=Sophos;i="5.90,252,1643702400"; d="scan'208";a="287138868" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2022 07:36:23 -0700 X-IronPort-AV: E=Sophos;i="5.90,252,1643702400"; d="scan'208";a="525557138" Received: from srkondle-mobl.amr.corp.intel.com (HELO [10.212.113.6]) ([10.212.113.6]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2022 07:36:21 -0700 Message-ID: Date: Mon, 11 Apr 2022 07:36:26 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Content-Language: en-US To: "zhangfei.gao@foxmail.com" , 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: Dave Hansen Subject: Re: [PATCH v4 05/11] iommu/sva: Assign a PASID to mm on PASID allocation and free it on mm exit In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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_? 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?