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 8B4A4C433F5 for ; Tue, 4 Jan 2022 07:27:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233167AbiADH1N (ORCPT ); Tue, 4 Jan 2022 02:27:13 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:37202 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231707AbiADH1L (ORCPT ); Tue, 4 Jan 2022 02:27:11 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 529E3B81155; Tue, 4 Jan 2022 07:27:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04620C36AE9; Tue, 4 Jan 2022 07:27:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1641281228; bh=YAiWEaNKF4OI+SkuBr/lyYfKRYi/Gm5pnRDcrQZpCmU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=p6Dr+J3eoIPr88f5SrpQUnwUrZXyoXl/kT2XVwpgjzziwr/C0+obD7+XFPCiS5pA7 LcOcSUxCPaH9WAurgjU7r0c4wPzq25/p67w0pWTMTlO2xSFot/3nCYkkTHfEZaY/aE +8m2UB+PCmWQCSUeqB1Kj9ZqkVXPMfEwduaVkorc= Date: Tue, 4 Jan 2022 08:27:06 +0100 From: Greg Kroah-Hartman To: Walt Drummond Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Jiri Slaby , Arnd Bergmann , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org Subject: Re: [RFC PATCH 8/8] signals: Support BSD VSTATUS, KERNINFO and SIGINFO Message-ID: References: <20220103181956.983342-1-walt@drummond.us> <20220103181956.983342-9-walt@drummond.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220103181956.983342-9-walt@drummond.us> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 03, 2022 at 10:19:56AM -0800, Walt Drummond wrote: > Support TTY VSTATUS character, NOKERNINFO local control bit and the > signal SIGINFO, all as in 4.3BSD. I am sorry, but this changelog text does not make any sense to me at all. It needs to be much more detailed and explain why you are doing this and what exactly it is doing as I have no idea. Also, you seem to be adding new user/kernel apis here with no documentation that I can see, nor any tests. So how is anyone supposed to use this? And finally: > --- /dev/null > +++ b/drivers/tty/tty_status.c > @@ -0,0 +1,135 @@ > +// SPDX-License-Identifier: GPL-1.0+ Please no, you know better than that, and the checkpatch tool should have warned you. > +/* > + * tty_status.c --- implements VSTATUS and TIOCSTAT from BSD4.3/4.4 > + * > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#define MSGLEN (160 + TASK_COMM_LEN) > + > +inline unsigned long getRSSk(struct mm_struct *mm) > +{ > + if (mm == NULL) > + return 0; > + return get_mm_rss(mm) * PAGE_SIZE / 1024; > +} > + > +inline long nstoms(long l) > +{ > + l /= NSEC_PER_MSEC * 10; > + if (l < 10) > + l *= 10; > + return l; > +} > + > +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) { > + if (old->start_time > new->start_time) > + return old; > + return new; > + } > + > + if (ostate < nstate) > + return old; > + > + return new; > +} > + > +struct task_struct *pick_process(struct pid *pgrp) Also, always run sparse on your changes, you have loads of new global functions for no reason. thanks, greg k-h