Received: by 2002:a19:f614:0:0:0:0:0 with SMTP id x20csp66920lfe; Fri, 15 Apr 2022 19:50:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFjYjKe7RP7sZKKwmEgafXf1IOk1b3n+UOVn0GLyLUQERF3ZglRMC4uKhyk7aT2lB/KYbP X-Received: by 2002:a17:90b:4a82:b0:1c7:8a44:e0c9 with SMTP id lp2-20020a17090b4a8200b001c78a44e0c9mr7264372pjb.102.1650077428696; Fri, 15 Apr 2022 19:50:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650077428; cv=none; d=google.com; s=arc-20160816; b=xVR28p1rWIP8VinGiUFwhTr62kayMhAjZpbIy9lhrI6MbF5fZp4/ULenSbZTtMBpyR MhlxRzAQ0s7KnQ/uCV8Z0LMJ9bVrCxLVUKqVSpALF3eAF6vGycQeeAyR+AFm2UZeH7DB 8jlhPs4kBFebVaVKgcZ04a3+xNQ9glXfEPEB+T3Edc6ieFsCZf4KAnDcvEQdS4N/2ttp 9Wy9HS5sIxXYINVLGQ150AZNkqYhuVqpFwsjheI2H9auoinRfwICnLH2K0IJMIPZoJvd 3u3/8psvyelrk99lKjNlWpuHhsw2qdS+S0PbIPWMb1EFhthL9/+BaqVRwG4bKlfyfcpR uaow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:from:references:cc:to :subject:message-id:dkim-signature; bh=MRhdO0cz7cxp9uoazzUTQIFzQSvjWuvNyJYajb1r9is=; b=da2Il6Szbh2qKju96e5Kw5l3hTFVAtNEXEVAel+C/RbWxhvcKbh3GOg9P2Dq/CQ0m4 XYX+HWI5ywyvoyOZYkQnpGsvkSA55mJtum+RCAd445f7QhztKQpyWN2WvC09+3uoDe4b dWQH5KQBWIMRUZsgj2AUeAxZDv8kYTU4avwueV4lZ4oq8ogqydMl/2cyRKitjCC8uy1L cnu4Ky0qrVJ73aT//O/oC8sYsVICINAbl87AvrnZRKQUfsqQ8VlcAigP2/1M0Stc+lYh put5+MJ8XkuLoomdkybNWte9zIia5oidk56XdleQVWcPRFwdtf0qIEylPCSx/AmBXFP4 WEjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foxmail.com header.s=s201512 header.b="W5uB/Ds1"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foxmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id k19-20020a056a00169300b004fa3a8dffb5si3528149pfc.108.2022.04.15.19.50.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 19:50:28 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@foxmail.com header.s=s201512 header.b="W5uB/Ds1"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foxmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D128D6EB26; Fri, 15 Apr 2022 19:08:06 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229702AbiDPCJ3 (ORCPT + 99 others); Fri, 15 Apr 2022 22:09:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229727AbiDPCGc (ORCPT ); Fri, 15 Apr 2022 22:06:32 -0400 Received: from out162-62-57-87.mail.qq.com (out162-62-57-87.mail.qq.com [162.62.57.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51335183BF for ; Fri, 15 Apr 2022 19:02:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1650074523; bh=MRhdO0cz7cxp9uoazzUTQIFzQSvjWuvNyJYajb1r9is=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=W5uB/Ds1oVQ4J6kkjBT+5KY45ZBuZ9PLGTWIzX7ao8DXahUAzzmTvIInMDLBecTAC dlW+fR0NsnuDVTqQn38BzDYrHT5jta+RSw+bH6Hv41St8TAxJ5aERW4C/uezRHHRLa cFL+RwQzbzkNdqGWrPh6fttb4g1Xm4BtsZeRsvSw= Received: from [IPv6:240e:362:47d:9500:6527:51dc:8ce2:179e] ([240e:362:47d:9500:6527:51dc:8ce2:179e]) by newxmesmtplogicsvrsza8.qq.com (NewEsmtp) with SMTP id 798346B3; Sat, 16 Apr 2022 09:30:24 +0800 X-QQ-mid: xmsmtpt1650072624trb9mmb58 Message-ID: X-QQ-XMAILINFO: M/NR0wiIuy70QpzxApsWPM1NiJ2tyeChvdwskY/HojDIOHIeQ0wZc6DtJaB77C qxEIDkoQ3uTCgYYP6ee+dDWikpW+roqtweBaIiIoWtjSq4FYdXqgyKlh1W+X3La4Fm52vtXAHZtN QGTtG1RGhbFN1Beh1Gvvwb/4/bNgqE7dUd/HtnmAl9miMe8o0PhKi2Td8y0g6KCLZI2/pJuICMXz dnjGjTzPdhORuURiOksZgiPHNP9JAUHDWW1r+OPS9QwFIP54qQr0+UHN8aGidXfVRritM8e7PP1N R5LyQCRyan35JxttaPmLvptA0qyw5yPWFu32XQJ35apnA6zefnmaTG+WdQKcX+axk8bx65Ova19j 4sGwFsa2d8a87btvtEfkwuWh5Y+0+s2aItiBGm2i8aO/oqKMTJPHnJX9UKV2VlhkRc4gTY9Vm88c 9hA7KOMDjnU27aGpB1MDlb9xsXyi0R1mzsFVefiNbo+YvY/QSf8tIPPiTv3HgR4teG6SPboOKetE LDXtHUOUAun46pBGkPuCIQkcZei51Ddm7yNS+DaTxhjuZOhyZi63OUzymAIWJzRAScAeLyh3kIwM fsNthC9bD73kiUx22wxEvi4Q1z5/PjwDK5ksK9mzgONMdD7kQmd6UGcxLuFGrzc9gyeW2XCX4yuB ojC/oAmxC3vBwQ1hyA6eYW9FIA8gJLqtIKftoStNYDup+MHOeESwgJpEjllVnj9GeF0Rafxawzyg GY3RRyJ+/h2Bb49MZ1M4v1OtyvfDCZ385DVdO8Giy0MtsJfx/Myd19ZKXJOV2CLjCd3C+X9PkF9j dtbMCzek2zsz+UuQje9bwlDnHjfXsNP4CWz4KdJVeJTTCZ/gIIEFQ/nLuEY5B5a6TiIRw2GSgKb1 IuK2uEJ7zCVPN4ZY0MJqwYJvHqlA7dG61k1q1cZNAVu2p6grqa1NAy2ZP/VkteQ6TsjM/1i1neey 1w/VaxJUdXnxVCxYyFJBB4i25C04vT Subject: Re: [PATCH v4 05/11] iommu/sva: Assign a PASID to mm on PASID allocation and free it on mm exit To: Fenghua Yu Cc: Dave Hansen , Joerg Roedel , jean-philippe , 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: <99bcb9f5-4776-9c40-a776-cdecfa9e1010@foxmail.com> From: "zhangfei.gao@foxmail.com" X-OQ-MSGID: <06436154-03dc-96c3-4e75-b7d982832d8a@foxmail.com> Date: Sat, 16 Apr 2022 09:30:21 +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 X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_MUA_MOZILLA,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,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 2022/4/15 下午8:37, Fenghua Yu wrote: > Hi, Zhangfei, > > On Fri, Apr 15, 2022 at 07:52:03PM +0800, zhangfei.gao@foxmail.com wrote: >> >> On 2022/4/15 下午6:50, Fenghua Yu wrote: >>> Hi, Zhangfei, >>> >>> On Fri, Apr 15, 2022 at 06:14:09PM +0800, zhangfei.gao@foxmail.com wrote: >>> I download this patch from: >>> https://lore.kernel.org/lkml/YllADL6uMoLllzQo@fyu1.sc.intel.com/raw >>> git am to either v5.18-rc2 or the latest upstream without any issue. >> It is my copy paste issue. >> >> I have tested, nginx woks well. > Great! > >> Other than the following issue, >> Each time /sbin/nginx will alloc ioasid but not free. >> which I think it maybe nginx issue or the mis-usage, will ask there. > Which nginx/openssl function is supposed to call kernel sva_unbind? I couldn't > find the function in nginx tree. > > If nginx doesn't free ioasid, it will cause ioasid leak and memory leak. Yes In my case, sva_bind/unbind is from openssl_engine, bind_fn, not in nginx itself nginx will use openssl -> openssl engine. nginx: src/core/nginx.c main ngx_ssl_init(log); OPENSSL_init_ssl(OPENSSL_INIT_LOAD_CONFIG, NULL) openssl_engine IMPLEMENT_DYNAMIC_BIND_FN(bind_fn) bind_fn sva_bind destroy sva_unbind But destroy seems not called in sbin/nginx -s quit. Thanks