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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2DD97C433F5 for ; Tue, 18 Jan 2022 14:29:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 73A8D6B0074; Tue, 18 Jan 2022 09:29:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6C4AF6B0075; Tue, 18 Jan 2022 09:29:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 564796B007B; Tue, 18 Jan 2022 09:29:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0211.hostedemail.com [216.40.44.211]) by kanga.kvack.org (Postfix) with ESMTP id 3F83C6B0074 for ; Tue, 18 Jan 2022 09:29:21 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id E8754180CA82B for ; Tue, 18 Jan 2022 14:29:20 +0000 (UTC) X-FDA: 79043640480.08.A71C4B6 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf23.hostedemail.com (Postfix) with ESMTP id 0E729140005 for ; Tue, 18 Jan 2022 14:29:19 +0000 (UTC) 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: X-Rspamd-Queue-Id: 0E729140005 X-Stat-Signature: 7isw99hg7rwwj9edfb5wpi1dpujm7tys Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=XWJBblrl; dmarc=none; spf=none (imf23.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=peterz@infradead.org X-Rspamd-Server: rspam03 X-HE-Tag: 1642516159-281053 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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; > > > +}