Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4604584imm; Mon, 30 Jul 2018 18:47:25 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfInXWNKHWPyhJeRjVrCRXS2CTzduariU5opaq0XSZg4cJIHJBGqtZQu2wwFSColdTod/el X-Received: by 2002:a17:902:20e9:: with SMTP id v38-v6mr18676435plg.107.1533001645053; Mon, 30 Jul 2018 18:47:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533001645; cv=none; d=google.com; s=arc-20160816; b=q0NrQQzsPbvpylKUk7M39pXr3zK1UZWD1T8YMonkj0AW2WzGT0kFMLUDg56rGSYOen +oIqpGUWxh3WXfajG5CeNfS4s6HNYRuu7TArR+9iLCx1koIoDxtfxrEFEB9L5v+GrRBf 1SVuoFx1vS1r+ajxvGkvlWNa0OCZJoT9hWiQFwCMsrblgCN2Qee+UurqxFvb3cA+z282 1yoH3jvUGvblujAeBYcpIQt0UYJORwmXfI3WeL1RrDa3mqk23PSpjcr1CSwbakevrvz3 mTjd1m6zOcjRASHOuwqAd51hPFlshSHFZ4ilDQCrjZi/ZapUuFzKg6zpLCFOXVTix/+X YxBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:arc-authentication-results; bh=sl9FsgxeLKf+hzQ/RchYQ2VCEeT3QdLSg1T2KaOnmvE=; b=Lr3ZYYuVbs7WPVl4eeynrwn+rWDvlhu4p+7vaFDMK1pnFPUjM0IGvkjbxydVwHYSxc rE4Ywb3DkhqNip2yDaghSAwxQmEukZlTyanwbAxigSmRT7tbyPmoXwLfskstN31bxO3W KXVodOZoa8W/0Y+TY2Ctg5pLY7pR2NDWoUgr49KiF0NruF2rjDIcQ+O6UpA3zRUnd2S2 S1xIcl0HqTVguHh1fmmgPGgq1Yqe1AtxmWXtQxU4krvRy98mHmksibPeA73h+GgJApDT Q2aK1R0FXXQdLr0o1A3kgDqR7wiXnKhjS5ndbUZYuEcy8Bx91hzOBBOJCiG++4KNtMSL sq2Q== 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 m2-v6si5561228plt.259.2018.07.30.18.47.10; Mon, 30 Jul 2018 18:47:25 -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 S1731047AbeGaDYK (ORCPT + 99 others); Mon, 30 Jul 2018 23:24:10 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:10183 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726659AbeGaDYK (ORCPT ); Mon, 30 Jul 2018 23:24:10 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 7CC7F5FBCF3B3; Tue, 31 Jul 2018 09:46:16 +0800 (CST) Received: from [10.177.253.249] (10.177.253.249) by smtp.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.399.0; Tue, 31 Jul 2018 09:46:13 +0800 Subject: Re: [V9fs-developer] [PATCH 2/2] net/9p: add a per-client fcall kmem_cache To: Dominique Martinet 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> <20180731013556.GA1530@nautica> CC: , , Greg Kurz , Matthew Wilcox , From: piaojun Message-ID: <5B5FBF4C.3030605@huawei.com> Date: Tue, 31 Jul 2018 09:45:48 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20180731013556.GA1530@nautica> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.253.249] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/7/31 9:35, Dominique Martinet wrote: > 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. > It looks like an obvious promotion. >>> @@ -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. > Setting NULL is not a big matter, and I will hear others' opinion.