Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5790092pxb; Thu, 20 Jan 2022 04:46:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJwW2eHJfyLkRhyxYsI3+2S2p+u3SM2f5COHzBCM/Lx98gfExOTMQQo3qPRIRbYERmPPu+wf X-Received: by 2002:a17:902:e5c8:b0:14a:8500:ce85 with SMTP id u8-20020a170902e5c800b0014a8500ce85mr33799486plf.66.1642682804936; Thu, 20 Jan 2022 04:46:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642682804; cv=none; d=google.com; s=arc-20160816; b=ZAhPlTepO1c9r704TkQEFHmqCNWhrw0slwrAcmRfItFhSDlJa0l03nLlu7YGOXiY/o 07mzEcg+8OYsP6rFI70u3bKJTiA1oT3+Tv2FSuW+jzPO3Y/HJ7kMr915cWJWHATqubGR WulArkaJTnqFjhx6LOpt4HT6q/s1ntAmQ+sONWNvH+E+DBUYEt4JZ4jwnm9d0WJ42QKb sUaTChWDPG+A9iuOelTBJFfvKto3yr7CkFUPvkSQ/0JqxzBTb0TMoqztqExk8wIECfx2 lSU5NeHK86eMjVIFwJSylouYQxvxMm1+Oef+jpHEUWHVog9NDDxRfmLh4MUoC8VBFrEN VuNQ== 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; bh=6h1Zdr2EydcVe9RHTPIOffSWxJ2GattgKQcuFo1Sgpc=; b=DOFCmSua+SUN6lwadhtpanoKPZzle+5Eo8R3Bb3+V3Axcuen0HPuicig1LPwRPtQf2 ZjBEEY3W5OYnjZdMMre/wphh6u/GHjky1KOqbOwgpUGc1RnBfVZ0zVjkKR1h51wQE8kH UJeadFqNrhcoUzrO0SRMqGhWd4k5ZUB6giW6TPNnNrIvh2MVVLZ6LMRuWQtbmicvJutJ YZr1/xJfcGfA6qSMbUdY6K7GmgLXAB/TyyTAy7TZAUj2JkND3+ZbNJwnngqdLQVhejg9 RRZzB9Xp8RhPB/FTbv7uJa4r8nEY335Jxeso3sA62/vObN0iiwNMo3DSVM0PRS6wqPAc FeuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=XWJBblrl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i35si3335645pgi.48.2022.01.20.04.46.33; Thu, 20 Jan 2022 04:46:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=XWJBblrl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235933AbiARO3a (ORCPT + 99 others); Tue, 18 Jan 2022 09:29:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232943AbiARO3Z (ORCPT ); Tue, 18 Jan 2022 09:29:25 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1357FC061574 for ; Tue, 18 Jan 2022 06:29:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=6h1Zdr2EydcVe9RHTPIOffSWxJ2GattgKQcuFo1Sgpc=; b=XWJBblrlv8Jt4qr8OGjvdKAMAA QtTgYzW+R6Ivc64T0KV8TL1o2Fn+EalccwpsRJZW8YypLQ9laTwaCAb6Dg8XSpr4dlTOCb9bzKGfJ o5saOMBiNQAFQXrg3Xv/eXepOy74ZYZY16YjbhaK6f6z+Cy0hQgaeaoHwcbQMCvuaVqyTZrxs8tcf O3R5dQ3AkEJJ7yYXVE7fnJlvgYWAJdusI9l7+yZYp6giJtOPA367IxOxLHNprrIYbMZXKq5lidqJ3 cJBiEa8HWnitjLWIbs2MgfEz3eIfF4sqcCOkgDP5EuTXg80xQEX1avksD9OfFlPt81imSi0cybGsR wL1RNeMw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1n9pTx-009HrY-Kd; Tue, 18 Jan 2022 14:29:10 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 17A63300252; Tue, 18 Jan 2022 15:29:08 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id F32442015FD51; Tue, 18 Jan 2022 15:29:07 +0100 (CET) Date: Tue, 18 Jan 2022 15:29:07 +0100 From: Peter Zijlstra To: Jiri Slaby Cc: Walt Drummond , Greg Kroah-Hartman , ar@cs.msu.ru, linux-kernel@vger.kernel.org, Oleg Nesterov , mm , Ingo Molnar Subject: Re: [PATCH 3/3] status: Display an informational message when the VSTATUS character is pressed or TIOCSTAT ioctl is called. Message-ID: References: <20220118044323.765038-1-walt@drummond.us> <20220118044323.765038-3-walt@drummond.us> <72a719a0-cd7c-9516-93c2-bd258930b71e@kernel.org> 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 On Tue, Jan 18, 2022 at 12:37:03PM +0100, Peter Zijlstra wrote: > > > +static inline struct task_struct *compare(struct task_struct *new, > > > + struct task_struct *old) > > > +{ > > > + unsigned int ostate, nstate; > > > + > > > + if (old == NULL) > > > + return new; > > > + > > > + ostate = task_state_index(old); > > > + nstate = task_state_index(new); > > > + > > > + if (ostate == nstate) { > > That's not an ordered set, please don't do that. *sigh*.. sorry about that, I can't read, for some reason I thought you did: ostate < nstate... > > > + if (old->start_time > new->start_time) > > > + return old; > > > + return new; > > > + } > > > + > > > + if (ostate < nstate) > > > + return old; > > > + > > > + return new; > > > +}