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 X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0FEAC433DF for ; Wed, 13 May 2020 20:44:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D2A8B205ED for ; Wed, 13 May 2020 20:44:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20150623.gappssmtp.com header.i=@kernel-dk.20150623.gappssmtp.com header.b="bkPaGKRl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D2A8B205ED Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0540380039; Wed, 13 May 2020 16:44:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F1F998000B; Wed, 13 May 2020 16:44:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DE5A780039; Wed, 13 May 2020 16:44:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0178.hostedemail.com [216.40.44.178]) by kanga.kvack.org (Postfix) with ESMTP id C1C288000B for ; Wed, 13 May 2020 16:44:21 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 79F638248047 for ; Wed, 13 May 2020 20:44:21 +0000 (UTC) X-FDA: 76812873522.08.rub47_6034dd42b4b02 X-HE-Tag: rub47_6034dd42b4b02 X-Filterd-Recvd-Size: 5452 Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Wed, 13 May 2020 20:44:20 +0000 (UTC) Received: by mail-pj1-f67.google.com with SMTP id s69so3311641pjb.4 for ; Wed, 13 May 2020 13:44:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=G5/0GM4ZmuZwR2FgC3QWReM0MKhUaUfkrXxZpMmrHMw=; b=bkPaGKRlhOXeaw2n/1eHqNp4hfObjbGXmRv2Iub1jab521hwpy+74Y75JQEVBytXtt Jg3PoHNbLXiotVcSmJdGiJCkQmt6w+3Rx86VGDCTMZ0M74SrMh07p23EFCEpMC7CdIhp GGbnOoRrRZ7lfz+rvkKIrs0Wq3OXd/kaqdOKtkK/jcXHiA0d/Q5402nu5CPTp4cP5Scz 8i1RIFpmK2hs26o/n75m2agt+cSnS6NutGqNPJHJdIVa8y8gvvVYB4dyXJF+OOwadGRe Z/L7Iixey3ve6qww9tw1hDRQfR7M5J3YzbIoInl1QQOd9ZUebQkCzzlsFVEgQ1IvKqEa 5nhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=G5/0GM4ZmuZwR2FgC3QWReM0MKhUaUfkrXxZpMmrHMw=; b=DxW9nMSBP+vd9rbl1u+JJYtK03vt7g69ufUDMNoPbEFg6XoN8MhONyBV1c5/fhO6cQ pQuZ76vQJpB1PHQqFmQMvi+36aepRA6GS3yRnxsSXTSEy6N5TVWsZWBH2DTdysMdkssC v+NpXzcUFi91nTIh9aPJLHNrxBbwp+ga1GxWYr18m8aA/qm7PF/gDjPaztW7Fnm1zgyf VwVyQ2uas3IEf0n6oS68o8/HHTFhc4Tfplf30PsI0ElLFwMppdE0Wg1PlfZrpjV0/rQ5 31ztdkUDygBcWKDWE9zjRLoyzqXEsLechlVBynxwR09Vou6wQGOZeVa06P+KI2SXB++g 1CZw== X-Gm-Message-State: AGi0PubsCrudDpk0qTPOo9Epfv+MdkMKOa91wxlAiKqwl3d4/t/tB5gJ 1LXT74t3zZq4Ugfa403qgduA/D1jTwU= X-Google-Smtp-Source: APiQypJWqXEusHksv4Brc3aquk6g4ocIDeG44NPtB72Xl0HZl6C4ejCno15ggtGpLULtM2kN9y7kZA== X-Received: by 2002:a17:90a:c702:: with SMTP id o2mr36044638pjt.196.1589402659390; Wed, 13 May 2020 13:44:19 -0700 (PDT) Received: from ?IPv6:2620:10d:c085:21d6::1150? ([2620:10d:c090:400::5:adac]) by smtp.gmail.com with ESMTPSA id l11sm2497418pjj.33.2020.05.13.13.44.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 13 May 2020 13:44:18 -0700 (PDT) Subject: Re: [PATCH RFC} io_uring: io_kiocb alloc cache To: Pekka Enberg , Jann Horn Cc: io-uring , Xiaoguang Wang , joseph qi , Jiufei Xue , Pavel Begunkov , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Linux-MM References: <492bb956-a670-8730-a35f-1d878c27175f@kernel.dk> <20200513191919.GA10975@nero> From: Jens Axboe Message-ID: <672c5a33-fcdf-86f8-e529-6341dcbdadca@kernel.dk> Date: Wed, 13 May 2020 14:44:16 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 5/13/20 2:31 PM, Pekka Enberg wrote: > Hi Jens, > > On 5/13/20 1:20 PM, Pekka Enberg wrote: >>> So I assume if someone does "perf record", they will see significant >>> reduction in page allocator activity with Jens' patch. One possible way >>> around that is forcing the page allocation order to be much higher. IOW, >>> something like the following completely untested patch: > > On 5/13/20 11:09 PM, Jens Axboe wrote: >> Now tested, I gave it a shot. This seems to bring performance to >> basically what the io_uring patch does, so that's great! Again, just in >> the microbenchmark test case, so freshly booted and just running the >> case. > > Great, thanks for testing! > > On 5/13/20 11:09 PM, Jens Axboe wrote: >> Will this patch introduce latencies or non-deterministic behavior for a >> fragmented system? > > You have to talk to someone who is more up-to-date with how the page > allocator operates today. But yeah, I assume people still want to avoid > higher-order allocations as much as possible, because they make > allocation harder when memory is fragmented. That was my thinking... I don't want a random io_kiocb allocation to take a long time because of high order allocations. > That said, perhaps it's not going to the page allocator as much as I > thought, but the problem is that the per-CPU cache size is just to small > for these allocations, forcing do_slab_free() to take the slow path > often. Would be interesting to know if CONFIG_SLAB does better here > because the per-CPU cache size is much larger IIRC. Just tried with SLAB, and it's roughly 4-5% down from the baseline (non-modified) SLUB. So not faster, at least for this case. -- Jens Axboe