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 4228AC4332F for ; Wed, 23 Mar 2022 12:06:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235866AbiCWMIP (ORCPT ); Wed, 23 Mar 2022 08:08:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244167AbiCWMIM (ORCPT ); Wed, 23 Mar 2022 08:08:12 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2059.outbound.protection.outlook.com [40.107.237.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A8AD6462; Wed, 23 Mar 2022 05:06:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kVpB2D335nkDtuks2i6N9Qy0u/BLLBoM7adCRAQqq9CIVJC6SLs03uKYiSmxFdK3Vn/JXNcwEOfKWKSb8/A1YWR9Ti9p0MMlzM4RH5oKQBjIvZLWy885mGqZTgLEeZvVlhLGFjnMmP0gWNzl5MjHPZsyrRxOy6maBw2q8N32b/3kBIVxgS+RhdRpgnb0IGjz15zrSvkxiSk0We5+ZxJ1X824CQ1B7Yuqx6q9xW9TouTjXU84hdOKEyEE6AUeCDN0XGHYdxQwJl4cKNv1snHv46CTIM4mbjKnPQ+AaXMdIexGjG4pce9YA3mepOFbziP+btmtFt3qMOsZCFhL1YVWag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zZddvL3/8Jcn60h01nM84H8jvC6V0u7YPSMGbhBdrFQ=; b=PphzLxZBjJzwRfzHnmJISmknpkcgm8UE4oFgfoP2zdjhGWaqhX1z7gLeFM4ahnZRiSP3gPDONJA6z3wmxYamJ1gJcyYsrIfpl1RfC1v+ALI55CHR+wMpeXxklgsHk1A21jt93mtPhssUcbMw4A3U5DEVW0Z5PY+n4YULMu5xe/AvjmV2XOoAnIUPb1YzrShgieyQHAru9xY5SpBXXVip4YI0gneLzXld7l7aVZDFFQYd07V/ZeZ7ggTjS2pdrARQ3QdDhY/SyfNrE4UtH1imc5+0NZEJSJv7GwK/pbJHddCYhZtt8L/+TNJ/i3GVJ0+4+n9+zV43VdczJu0Nc0puww== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ddn.com; dmarc=pass action=none header.from=ddn.com; dkim=pass header.d=ddn.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ddn.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zZddvL3/8Jcn60h01nM84H8jvC6V0u7YPSMGbhBdrFQ=; b=ejOInUGasHIdu14Ca8uU225IwLBVdKKmjAmcz+I2I63JK0DZvQoanfGCT8aQQzkgs2l0OvAKslCqmnqMdmXDPkQlXmJsd4zFsZe14CBQrm9xXFv/k0m+phATsc+hvKeBDYN+N0k2BdqGxR1gxDvq4LyjQWAPxx/00IqvKPL19z8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=ddn.com; Received: from DM5PR1901MB2037.namprd19.prod.outlook.com (2603:10b6:4:aa::29) by SA0PR19MB4288.namprd19.prod.outlook.com (2603:10b6:806:81::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.16; Wed, 23 Mar 2022 12:06:40 +0000 Received: from DM5PR1901MB2037.namprd19.prod.outlook.com ([fe80::a012:79d3:ea4e:b406]) by DM5PR1901MB2037.namprd19.prod.outlook.com ([fe80::a012:79d3:ea4e:b406%6]) with mapi id 15.20.5102.016; Wed, 23 Mar 2022 12:06:40 +0000 Message-ID: Date: Wed, 23 Mar 2022 13:06:33 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [RFC PATCH] getvalues(2) prototype Content-Language: en-US To: Greg KH Cc: Miklos Szeredi , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, linux-man@vger.kernel.org, linux-security-module@vger.kernel.org, Karel Zak , Ian Kent , David Howells , Linus Torvalds , Al Viro , Christian Brauner , Amir Goldstein , James Bottomley , Dharmendra Singh References: <20220322192712.709170-1-mszeredi@redhat.com> From: Bernd Schubert In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PR3P191CA0058.EURP191.PROD.OUTLOOK.COM (2603:10a6:102:55::33) To DM5PR1901MB2037.namprd19.prod.outlook.com (2603:10b6:4:aa::29) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4b73bdf5-1418-4b9b-9abe-08da0cc59699 X-MS-TrafficTypeDiagnostic: SA0PR19MB4288:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zoxUIgZr0HMhfVZ4L7vPTQxSbcWaGO1RYlU7BZ7DqJNZAdNtvulEUAb0qJLLi6uw3H8oCTBRBDPhA+ZknbRkTBYqW+fx+ab/CLxk341f6qAEai0fdHi75zmNIXI/lak+WuQKfhnMYMIJwBEif85LU0AsaLEfk5XYAJ+jDvmQfJVCNnXUtCaOw+5tR3QXGLDDD4S775WxScWq3c/RNCstzy33/Ko6O7u6oh9Nez/EcyUZqCvVdOqB2hhCJR1OfiuOF6RJ3Pjz/l5y4ljiGZhCeNyBturBJydyBypX+qFcB8TIQMwiq4fjvzD3YSxiV+UPSc5W1VqnEBxylEOtaKbfnq13ozSLORrCm1hDXUvqxPGL0o2cfF2kjE16Dwz28oqpWeoqTzXTvEIH4I1H0Cwt9AQTAoTmAVo9cZxme3PUOqBtXrxzDG5kLH7cPARWG/YeSeE1d2KteADH9K0rOGAIcXBjDBJk9H3QbHpuGR73yDT8TjRQm0rl6VcYJIVjKO9fKi/2cr60aFrIdO9IDxRUjnqurysSJlfm4svsUOSPYL1AR97blCwtjHprbRqxuUI3++f+KceWaZbD1l8Jv94H0kN325fDEar9gRFmwM2N5QRnxnZ0UbA8S8vGHSqwNdbjmIo2EQxg+r5rLd5f0YFPkhr9/jC2YH0/E9ZeNE8OMEuUvh4329o+EngggpMiebm9HZ+zrQus7oSsqpwDth2SxGmlXLog2uqNQX9EL+QgAtA0jrdOPqG5VPZUOCYJBP/4Vs/Wy//Kkrm2QcBVYFG1qZheUwiXrPsf8ch6KKKobwA2rgiZkDZOdzI3qLb+Xxw+ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR1901MB2037.namprd19.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(86362001)(36756003)(6916009)(8936002)(54906003)(53546011)(2906002)(31696002)(316002)(2616005)(186003)(6666004)(6512007)(6506007)(66946007)(66556008)(966005)(6486002)(66476007)(38100700002)(31686004)(83380400001)(5660300002)(8676002)(7416002)(4326008)(508600001)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?QmVvOEQ2d1NsMFhpUUJvZjlJeVZ4VXhaWVg0cU5od0Y3RmRIVFljL0NtZXVk?= =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0N0t2MGhVcEpxK1hrQVNESVBJNllKV0dw?= =?utf-8?B?a1JHS3lMOTRqT1g3ZXdacGxBZUJRelBDa05aYTVmTjRaVTVpcWNJeGpQdngr?= =?utf-8?B?UWVWUEpFTEVWbXA2RWdCUlFaNjNWZXRVZUZwWW9TQld1UmJiWHRlaVl1cmpO?= =?utf-8?B?WEN6Wm9KZldKMUU5dDQ4Zm11V0F4Tkpwd1cvOEIzbllzQkpkcXpBVUQwYXFV?= =?utf-8?Q?lFUScm?= X-OriginatorOrg: ddn.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4b73bdf5-1418-4b9b-9abe-08da0cc59699 X-MS-Exchange-CrossTenant-AuthSource: DM5PR1901MB2037.namprd19.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Mar 2022 12:06:40.3117 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 753b6e26-6fd3-43e6-8248-3f1735d59bb4 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mA9kedMf8skoLnfbQPAxX3gKgG/bNYpyoDBHVb46FgwwQuG/xPGt4c7ifWfMGq7Rzyqpb8tQmXf8YOUaNi02ZQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR19MB4288 Precedence: bulk List-ID: X-Mailing-List: linux-api@vger.kernel.org On 3/23/22 12:42, Greg KH wrote: > On Wed, Mar 23, 2022 at 11:26:11AM +0100, Bernd Schubert wrote: >> On 3/23/22 08:16, Greg KH wrote: >>> On Tue, Mar 22, 2022 at 08:27:12PM +0100, Miklos Szeredi wrote: >>>> Add a new userspace API that allows getting multiple short values in a >>>> single syscall. >>>> >>>> This would be useful for the following reasons: >>>> >>>> - Calling open/read/close for many small files is inefficient. E.g. on my >>>> desktop invoking lsof(1) results in ~60k open + read + close calls under >>>> /proc and 90% of those are 128 bytes or less. >>> >>> As I found out in testing readfile(): >>> https://lore.kernel.org/r/20200704140250.423345-1-gregkh@linuxfoundation.org >>> >>> microbenchmarks do show a tiny improvement in doing something like this, >>> but that's not a real-world application. >>> >>> Do you have anything real that can use this that shows a speedup? >> >> Add in network file systems. Demonstrating that this is useful locally and >> with micro benchmarks - yeah, helps a bit to make it locally faster. But the >> real case is when thousands of clients are handled by a few network servers. >> Even reducing wire latency for a single client would make a difference here. > > I think I tried running readfile on NFS. Didn't see any improvements. > But please, try it again. Also note that this proposal isn't for NFS, > or any other "real" filesystem :) How did you run it on NFS? To get real benefit you would need to add a READ_FILE rpc to the NFS protocol and code? Just having it locally won't avoid the expensive wire calls? > >> There is a bit of chicken-egg problem - it is a bit of work to add to file >> systems like NFS (or others that are not the kernel), but the work won't be >> made there before there is no syscall for it. To demonstrate it on NFS one >> also needs a an official protocol change first. And then applications also >> need to support that new syscall first. >> I had a hard time explaining weather physicist back in 2009 that it is not a >> good idea to have millions of 512B files on Lustre. With recent AI workload >> this gets even worse. > > Can you try using the readfile() patch to see if that helps you all out > on Lustre? If so, that's a good reason to consider it. But again, has > nothing to do with this getvalues(2) api. I don't have a Lustre system to easily play with (I'm working on another network file system). But unless Lustre would implement aggressive prefetch of data on stat, I don't see how either approach would work without a protocol addition. For Lustre it probably would be helpful only when small data are inlined into the inode. In end this is exactly the chicken-egg problem - Lustre (or anything else) won't implement it before the kernel does not support it. But then the new syscall won't be added before it is proven that it helps. - Bernd