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 21376C433EF for ; Fri, 25 Mar 2022 10:59:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353149AbiCYLB0 (ORCPT ); Fri, 25 Mar 2022 07:01:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243420AbiCYLBY (ORCPT ); Fri, 25 Mar 2022 07:01:24 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 242C2BF003; Fri, 25 Mar 2022 03:59:51 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id D5B831F7AE; Fri, 25 Mar 2022 10:59:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1648205989; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=V6tPqgzCb9zg9WADmlRJi4ubhrh85zcKZfitkRteJEc=; b=Fl64pbvzri2ql+VIJYK/EkRry3sifm/+KDJt92c9AHrWo41fW+sr17QEALHzahpeEYcSYX BBb9YhfXp+RUu3ruIsBPFRy5/KymjIzBLkKQdW51/iMJVD6rUKGS6rwlVL47eHW/zdWHaS ikS8rXhvqEsM92gBP5fCR/O7N/Yukt4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1648205989; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=V6tPqgzCb9zg9WADmlRJi4ubhrh85zcKZfitkRteJEc=; b=feCy0wnHg5d0Am4EuSbi+3Sf4OxxFvX66S2Q5fKwxGWKBMcjIc8eSXpYzr5OoB2HWW9EPx N9K2RDVf9U5OqoCw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id BA71B1332D; Fri, 25 Mar 2022 10:59:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id w2gCLKWgPWKeLgAAMHmgww (envelope-from ); Fri, 25 Mar 2022 10:59:49 +0000 Date: Fri, 25 Mar 2022 12:02:09 +0100 From: Cyril Hrubis To: Miklos Szeredi Cc: Theodore Ts'o , Christian Brauner , Miklos Szeredi , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Linux API , linux-man , LSM , Karel Zak , Ian Kent , David Howells , Linus Torvalds , Al Viro , Christian Brauner , Amir Goldstein , James Bottomley Subject: Re: [RFC PATCH] getvalues(2) prototype Message-ID: References: <20220322192712.709170-1-mszeredi@redhat.com> <20220323114215.pfrxy2b6vsvqig6a@wittgenstein> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! > > If so, have you benchmarked lsof using this new interface? > > Not yet. Looked yesterday at both lsof and procps source code, and > both are pretty complex and not easy to plug in a new interface. But > I've not yet given up... Looking at lsof it seems to use fopen() and fgets() to parse various proc files. I doubt that we can make the parsing singificantly faster without completely rewriting the internals. As for procps the readproc.c has file2str() function that does copy whole proc files into a buffer with open() - read() - close(). It may be reasonably easy to hook the new systall there and it will probably make ps and top slightly faster. -- Cyril Hrubis chrubis@suse.cz