Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4597712imm; Mon, 30 Jul 2018 18:37:14 -0700 (PDT) X-Google-Smtp-Source: AAOMgpftB5ojHLFU4lKmYayxQuAvCTg/6lhnPQZDXq1/+bq0AaQY2Bc7SARNegJgdz2ioU9Y95h8 X-Received: by 2002:a63:d10c:: with SMTP id k12-v6mr18865088pgg.49.1533001034551; Mon, 30 Jul 2018 18:37:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533001034; cv=none; d=google.com; s=arc-20160816; b=EOeSYhbo/oU8cLlMwwAVQmzFjE1PFPVDcCcNUAo8zucKiMUaf3SIqvaxk4bYw3WTCX irhoVOrRy5WHiXSyYdccO4+rVnIKKq2nkE95DgOyT1vmYgsWS44NBk/cNqJsxfj13sKi DjV0F5tZJPRtork+bFWxQzM2WiKozHx+Rcvz4atCDkrmCJp2DpCH5fqIafywpUmXBWUZ kXUAJRxYI+8h/k+g1PheXQaStqBLfeWhzQxBkjeoPOaoeRnTAXHhLah+g5aNvhz9ciRx +PbRnQYHcgom/GXdvyJj20bH4mSHuq6HDxJ3RFpR9GnB/8FFvCi0gc7syvG7Z8mudiAa mZig== 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:message-id:subject:cc :to:from:date:arc-authentication-results; bh=HW5UixR7iz0BDbGvUm8EASN/pMebxpELSHqCS/XDNdk=; b=p5/XPHx8ixuh2zmV3p4b8V+wr5Qrp8uqOQDuwWOurOEuWZeLXK7cqRJQjs21s/SDla ZdjPVgU8v/AeCsdvX8lcIIT9ENFf0U08mu68SAyrawDO9Q9daHp0s1eOEVZmlDj1Yaps IH2GJf0qL/E2OPT/3x2tXkff4PJi+80l6qTiGwrbETxWiNbuYJTog7ozTzxf2ipkcO+n shGY+7ve9XkbSGZhqGujIDxIl/4xtC2/Kjgvxh3OPlQ+BvkMsUbUs9v0AZbAbHIkvOun sc+FWJ5/81+KTzEfDokpGeI7Zp4O8Uyaf4DrXbuHSiGSr6WKFH0MHYYBbqE8BtKGwXcC Vp1A== 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 3-v6si11512590pgq.529.2018.07.30.18.36.59; Mon, 30 Jul 2018 18:37:14 -0700 (PDT) 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 S1730841AbeGaDN6 (ORCPT + 99 others); Mon, 30 Jul 2018 23:13:58 -0400 Received: from nautica.notk.org ([91.121.71.147]:54752 "EHLO nautica.notk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727045AbeGaDN5 (ORCPT ); Mon, 30 Jul 2018 23:13:57 -0400 Received: by nautica.notk.org (Postfix, from userid 1001) id 9473EC009; Tue, 31 Jul 2018 03:36:11 +0200 (CEST) Date: Tue, 31 Jul 2018 03:35:56 +0200 From: Dominique Martinet To: piaojun Cc: v9fs-developer@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, Greg Kurz , Matthew Wilcox , linux-kernel@vger.kernel.org Subject: Re: [V9fs-developer] [PATCH 2/2] net/9p: add a per-client fcall kmem_cache Message-ID: <20180731013556.GA1530@nautica> References: <20180730093101.GA7894@nautica> <1532943263-24378-1-git-send-email-asmadeus@codewreck.org> <1532943263-24378-2-git-send-email-asmadeus@codewreck.org> <5B5FB8F0.6020908@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5B5FB8F0.6020908@huawei.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org piaojun wrote on Tue, Jul 31, 2018: > Could you help paste some test result before-and-after the patch applied? The only performance tests I did were sent to the list a couple of mails earlier, you can find it here: http://lkml.kernel.org/r/20180730093101.GA7894@nautica In particular, the results for benchmark on small writes just before and after this patch, without KASAN (these are the same numbers as in the link, hardware/setup is described there): - no alloc (4.18-rc7 request cache): 65.4k req/s - non-power of two alloc, no patch: 61.6k req/s - power of two alloc, no patch: 62.2k req/s - non-power of two alloc, with patch: 64.7k req/s - power of two alloc, with patch: 65.1k req/s I'm rather happy with the result, I didn't expect using a dedicated cache would bring this much back but it's certainly worth it. > > @@ -1011,6 +1034,7 @@ void p9_client_destroy(struct p9_client *clnt) > > > > p9_tag_cleanup(clnt); > > > > + kmem_cache_destroy(clnt->fcall_cache); > > We could set NULL for fcall_cache in case of use-after-free. > > > kfree(clnt); Hmm, I understand where this comes from, but I'm not sure I agree. If someone tries to access the client while/after it is freed things are going to break anyway, I'd rather let things break as obviously as possible than try to cover it up. -- Dominique