lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YebOs1OWRAru2v5B@hirez.programming.kicks-ass.net>
Date:   Tue, 18 Jan 2022 15:29:07 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Jiri Slaby <jirislaby@...nel.org>
Cc:     Walt Drummond <walt@...mmond.us>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>, ar@...msu.ru,
        linux-kernel@...r.kernel.org, Oleg Nesterov <oleg@...hat.com>,
        mm <linux-mm@...ck.org>, Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH 3/3] status: Display an informational message when the
 VSTATUS character is pressed or TIOCSTAT ioctl is called.

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;
> > > +}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ