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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE3F8C433FE for ; Fri, 1 Apr 2022 16:28:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343809AbiDAQam (ORCPT ); Fri, 1 Apr 2022 12:30:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351580AbiDAQ3v (ORCPT ); Fri, 1 Apr 2022 12:29:51 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E91917B881 for ; Fri, 1 Apr 2022 09:02:53 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id lr4so6739386ejb.11 for ; Fri, 01 Apr 2022 09:02:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XojI5NG1Ngof+DXqgpy8fylrJvLLgcTEPWV9wOr8fTQ=; b=DVZdN5f/SNejskyFVUDLPktpTitdcrdg9j0rCyGoqWJjEoZ+CKGXAnVVMZ8vptI81S Eq+1zOhKnyyl/ggnQ2pobeILTbLBdG8l+Dz9WWuwG+TivGAhoaMJForW6yR6k0fgIQFI NRumHVY31gRgznXK6XyF5nRxuHDp64UtJI4HE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XojI5NG1Ngof+DXqgpy8fylrJvLLgcTEPWV9wOr8fTQ=; b=q1SUTWLUUQKq4VwFYAl/CW91bVbVxsw716rPn247sLp/WRWpRARDgrP4u/p28cL3Hh 69Z3l5vkmr5X81JAfypzWKh9qQ056moCVuujXhvMIxDo/LSRU2guy8hnF9iKQCsxV9xa 5TOPFH3JpbTeBN9U0sg6p9Nl2RJaKa9CkIbtCBlTLmaSkJnoDSfoMruipaGKxuygY0+R QoVGs6kskHVpnGRbB10sWX2ic1777Su5hvsmiVjyw/akm5TfXmfvjwFfvMQhqBB3vKU+ 6nJm0xkrFWsPIheb9u6JbUtZcpS68rxheiBtRSz56DiTOmgQzgOS3AlrW71WVjCICFvn 2/iA== X-Gm-Message-State: AOAM532JChM7cSgg/gijAeO+bY+Dmz0iUosgEk5p8IpLb+pxDj8ssj0v Q1VMPvJFIL5Nm74AbXrDzftEffg3JlfTA4p3cWtHwW2N2YdHZA== X-Google-Smtp-Source: ABdhPJxVxTmCsiSNrZ1UbbYCiKNxxbMcSDejmF87PKv8TSfccvPLZWus5HTaACmPHYtAY+dSYJs/cqODo7/VWDOoyD4= X-Received: by 2002:a17:907:62aa:b0:6e0:f208:b869 with SMTP id nd42-20020a17090762aa00b006e0f208b869mr443045ejc.270.1648828972426; Fri, 01 Apr 2022 09:02:52 -0700 (PDT) MIME-Version: 1.0 References: <89322bd1-5e6f-bcc6-7974-ffd22363a165@kernel.dk> <0c5745ab-5d3d-52c1-6a1d-e5e33d4078b5@kernel.dk> <52dca413-61b3-8ded-c4cc-dd6c8e8de1ed@kernel.dk> <23b62cca-8ec5-f250-e5a3-7e9ed983e190@kernel.dk> <77229971-72cd-7d78-d790-3ef4789acc9e@kernel.dk> <61c2336f-0315-5f76-3022-18c80f79e0b5@kernel.dk> <38436a44-5048-2062-c339-66679ae1e282@kernel.dk> In-Reply-To: From: Miklos Szeredi Date: Fri, 1 Apr 2022 18:02:40 +0200 Message-ID: Subject: Re: io_uring_prep_openat_direct() and link/drain To: Jens Axboe Cc: io-uring@vger.kernel.org Content-Type: multipart/mixed; boundary="000000000000329f7105db99e98f" Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org --000000000000329f7105db99e98f Content-Type: text/plain; charset="UTF-8" On Fri, 1 Apr 2022 at 17:36, Jens Axboe wrote: > I take it you're continually reusing those slots? Yes. > If you have a test > case that'd be ideal. Agree that it sounds like we just need an > appropriate breather to allow fput/task_work to run. Or it could be the > deferral free of the fixed slot. Adding a breather could make the worst case latency be large. I think doing the fput synchronously would be better in general. I test this on an VM with 8G of memory and run the following: ./forkbomb 14 & # wait till 16k processes are forked for i in `seq 1 100`; do ./procreads u; done You can compare performance with plain reads (./procreads p), the other tests don't work on public kernels. Thanks, Miklos --000000000000329f7105db99e98f Content-Type: text/x-csrc; charset="US-ASCII"; name="procreads.c" Content-Disposition: attachment; filename="procreads.c" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_l1glslpr0 I2RlZmluZSBfR05VX1NPVVJDRQoKI2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxmY250bC5o PgojaW5jbHVkZSA8c3RyaW5nLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPGRpcmVu dC5oPgojaW5jbHVkZSA8dW5pc3RkLmg+CiNpbmNsdWRlIDxlcnIuaD4KI2luY2x1ZGUgImxpYnVy aW5nLmgiCgojZGVmaW5lIENIRUNLX05FR0VSUihfZXhwcikgXAoJKHsgdHlwZW9mKF9leHByKSBf cmV0ID0gKF9leHByKTsgaWYgKF9yZXQgPCAwKSB7IGVycm5vID0gLV9yZXQ7IGVycigxLCAjX2V4 cHIpOyB9IF9yZXQ7IH0pCiNkZWZpbmUgQ0hFQ0tfTlVMTChfZXhwcikgXAoJKHsgdHlwZW9mKF9l eHByKSBfcmV0ID0gKF9leHByKTsgaWYgKF9yZXQgPT0gTlVMTCkgeyBlcnJ4KDEsICNfZXhwciAi IHJldHVybmVkIE5VTEwiKTsgfSBfcmV0OyB9KQojZGVmaW5lIENIRUNLX0VSUihfZX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SB0cnVlOwoKCWZvciAoaSA9IDA7IGkgPCBu dW07IGkrKykgewoJCXZlY1tpXS52YWx1ZV9pbi5pb3ZfYmFzZSA9ICh0eXBlICE9ICd3JyB8fCAh aSkgPyBidWZbaV0gOiBOVUxMOwoJCXZlY1tpXS52YWx1ZV9pbi5pb3ZfbGVuID0gc2l6ZW9mKGJ1 ZltpXSk7Cgl9CgoJZHAgPSBDSEVDS19OVUxMKG9wZW5kaXIoIi9wcm9jIikpOwoJc3dpdGNoICh0 eXBlKSB7CgljYXNlICdwJzoKCQl0ZXN0X3BsYWluKGRwLCB2ZWMsIG51bSwgMCk7CgkJYnJlYWs7 CgljYXNlICdyJzoKCQl0ZXN0X3BsYWluKGRwLCB2ZWMsIG51bSwgMSk7CgkJYnJlYWs7CgljYXNl ICdzJzoKCQl0ZXN0X3BsYWluKGRwLCB2ZWMsIG51bSwgMik7CgkJYnJlYWs7CgljYXNlICd1JzoK CQl0ZXN0X3VyaW5nKGRwLCB2ZWMsIG51bSk7CgkJYnJlYWs7CgljYXNlICd3JzoKCQl2ZWNbMF0u dmFsdWVfaW4uaW92X2xlbiA9IHNpemVvZihidWZbMF0pICogbnVtOwoJCS8qIGZhbGx0aHJvdWdo ICovCgljYXNlICd2JzoKCWNhc2UgJ3onOgoJCXRlc3RfdmFsdWVzKGRwLCB2ZWMsIG51bSwgdHlw ZSA9PSAneicpOwoJCWJyZWFrOwoJfQoJY2xvc2VkaXIoZHApOwoJcmV0dXJuIDA7Cn0K --000000000000329f7105db99e98f Content-Type: text/x-csrc; charset="US-ASCII"; name="forkbomb.c" Content-Disposition: attachment; filename="forkbomb.c" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_l1gltctf1 I2luY2x1ZGUgPHVuaXN0ZC5oPgojaW5jbHVkZSA8c3RkaW8uaD4KI2luY2x1ZGUgPGVyci5oPgoj aW5jbHVkZSA8cHRocmVhZC5oPgojaW5jbHVkZSA8c3RkbGliLmg+CgpzdGF0aWMgdm9pZCAqcnVu KHZvaWQgKikKewoJc2xlZXAoMTAwMCk7CglyZXR1cm4gTlVMTDsKfQoKaW50IG1haW4oaW50IGFy Z2MsIGNoYXIgKmFyZ3ZbXSkKewoJaW50IHBpZCwgbGV2ZWwsIGk7CglwdGhyZWFkX3QgdGhyOwoJ aW50IG1heGxldmVsID0gYXRvaShhcmd2WzFdKTsKCglmb3IgKGxldmVsID0gMDsgbGV2ZWwgPCBt YXhsZXZlbDsgbGV2ZWwrKykgewoJCXBpZCA9IGZvcmsoKTsKCQlpZiAocGlkID09IC0xKQoJCQll cnIoMSwgImZvcmsiKTsKCgkJZnByaW50ZihzdGRlcnIsICIuIik7CgkJI2lmIDAKCQlpZiAocGlk ID09IDApIHsKCQkJZm9yIChpID0gMDsgaSA8IDQ7IGkrKykKCQkJCXB0aHJlYWRfY3JlYXRlKCZ0 aHIsIE5VTEwsIHJ1biwgTlVMTCk7CgoJCX0KCQkjZW5kaWYKCX0KCXNsZWVwKDEwMDApOwp9Cg== --000000000000329f7105db99e98f--