Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2085713pxb; Fri, 25 Mar 2022 10:49:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzP5CnmkkYHjZQ8PhEjLYPHFXxn0GichkTs8PLHaa9oZNq3speTceXi8e7CcrsttGfWGGrN X-Received: by 2002:a17:902:cf0f:b0:154:7a02:29f6 with SMTP id i15-20020a170902cf0f00b001547a0229f6mr12864601plg.10.1648230586985; Fri, 25 Mar 2022 10:49:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648230586; cv=none; d=google.com; s=arc-20160816; b=hckTq0GAVWHRdbpoRUi82+jPw4cAjiN0DfzRvFSkXz4bIyMdAb3t1RIKhYZDuRs1+d g7gJjKhK6HXkoxa/G/k6M6TboSetm+Z3F2e5aO2Km1aZhj8PpCQAEFDML5qh8MuDy+zr /W2K+fGql99qk5+5m5x4VtEPlO2QNXPFnNamAtgbnxpSNRLu9Gpmc8tayk5rk3BqdPxI UOgHfzi3BdYWpxUEcKB3qI4sE4KS9hT6+0Y1G42auSTZfRduWOHOxBw+nrDuqALTIsjK X+dFi9f65VOh2TdqZf/r48E1t+1QkCKRHA3XLU3Zd1cDnjieLRfqv6ANkXaLgfxPdOIF yqQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=V6tPqgzCb9zg9WADmlRJi4ubhrh85zcKZfitkRteJEc=; b=LNFjeeTLp2S99JfJoU5RV1mgMPTMMMLihWibJ6ubC41OjDxAbXaUNG20DzN4Wnezu6 cjiEBXP+1Ot+QjooAz600bWOqE8jvpefdT8ulb4nWTz7VlIRAqYGNGKGo9lTRRhvNDlz zDo9EGNchPqZU2jYtp8j/D+5hnL4m9/3IvuJHtxWBn5CnACVmDb32/3yh+6gUIHdPwHJ DuxoKsVze1j2c6ZFeRmDOhUjPXzRNprUVEpM07V3IVnWO757JfxeNYyWoUhCL0KV6xZF bE61pW6TjUb8Q5mesVtWNyKzFH2eri+r4UPk4eXaOwT/Ivr7bx9Pax/dY9rWKiI3jmh4 FN+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Fl64pbvz; dkim=neutral (no key) header.i=@suse.cz header.b=feCy0wnH; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id q1-20020a170902dac100b00153b2d16465si3389130plx.109.2022.03.25.10.49.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 10:49:46 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Fl64pbvz; dkim=neutral (no key) header.i=@suse.cz header.b=feCy0wnH; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3C6206141; Fri, 25 Mar 2022 10:33:12 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353113AbiCYLBZ (ORCPT + 99 others); Fri, 25 Mar 2022 07:01:25 -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: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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