Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1159951

Re: [RFC PATCH 11/18] jffs2: Convert jffs2_gcd_mtd kthread into the iterant API

Path csiph.com!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod
From Oleg Nesterov <oleg@redhat.com>
Newsgroups linux.kernel
Subject Re: [RFC PATCH 11/18] jffs2: Convert jffs2_gcd_mtd kthread into the iterant API
Date Sat, 06 Jun 2015 23:20:02 +0200
Message-ID <pytFw-3E8-7@gated-at.bofh.it> (permalink)
References <py1pT-3Kb-3@gated-at.bofh.it> <py1pT-3Kb-21@gated-at.bofh.it>
X-Original-To Petr Mladek <pmladek@suse.cz>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.18 (2008-05-17)
X-Scanned-By MIMEDefang 2.68 on 10.5.11.24
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 41
Organization linux.* mail to news gateway
X-Original-Cc Andrew Morton <akpm@linux-foundation.org>, Tejun Heo <tj@kernel.org>, Ingo Molnar <mingo@redhat.com>, Peter Zijlstra <peterz@infradead.org>, Richard Weinberger <richard@nod.at>, Steven Rostedt <rostedt@goodmis.org>, David Woodhouse <dwmw2@infradead.org>, linux-mtd@lists.infradead.org, Trond Myklebust <trond.myklebust@primarydata.com>, Anna Schumaker <anna.schumaker@netapp.com>, linux-nfs@vger.kernel.org, Chris Mason <clm@fb.com>, "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>, Thomas Gleixner <tglx@linutronix.de>, Linus Torvalds <torvalds@linux-foundation.org>, Jiri Kosina <jkosina@suse.cz>, Borislav Petkov <bp@suse.de>, Michal Hocko <mhocko@suse.cz>, live-patching@vger.kernel.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org
X-Original-Date Sat, 6 Jun 2015 23:16:48 +0200
X-Original-Message-ID <20150606211648.GA15591@redhat.com>
X-Original-References <1433516477-5153-1-git-send-email-pmladek@suse.cz> <1433516477-5153-12-git-send-email-pmladek@suse.cz>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref aioe.org linux.kernel:1159951

Show key headers only | View raw


On 06/05, Petr Mladek wrote:
>
> [*] In fact, there was a bug in the original code. It tried to process
>     a non-existing signal when the system was freezing. See the common
>     check for pending signal and freezing.

And another bug afaics:

> -			case SIGSTOP:
> -				jffs2_dbg(1, "%s(): SIGSTOP received\n",
> -					  __func__);
> -				set_current_state(TASK_STOPPED);
> -				schedule();
> -				break;

This is obviously racy, we can miss SIGCONT.

Still I personally dislike the new kthread_sigaction() API. I agree,
a couple if signal helpers for kthreads make sense. Say,

	void kthread_do_signal_stop(void)
	{
		spin_lock_irq(&curtent->sighand->siglock);
		if (current->jobctl & JOBCTL_STOP_DEQUEUED)
			__set_current_state(TASK_STOPPED);
		spin_unlock_irq(&current->sighand->siglock);

		schedule();
	}

and probably even "int kthread_signal_deque(void)".

But personally I do not think kthread_do_signal() makes a lot of sense...

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: [RFC PATCH 11/18] jffs2: Convert jffs2_gcd_mtd kthread into  the iterant API Oleg Nesterov <oleg@redhat.com> - 2015-06-06 23:20 +0200
  Re: [RFC PATCH 11/18] jffs2: Convert jffs2_gcd_mtd kthread into the  iterant API Jiri Kosina <jkosina@suse.cz> - 2015-06-06 23:40 +0200
    Re: [RFC PATCH 11/18] jffs2: Convert jffs2_gcd_mtd kthread into  the iterant API Oleg Nesterov <oleg@redhat.com> - 2015-06-07 00:40 +0200
      Re: [RFC PATCH 11/18] jffs2: Convert jffs2_gcd_mtd kthread into the  iterant API Jiri Kosina <jkosina@suse.cz> - 2015-06-07 00:50 +0200
        Re: [RFC PATCH 11/18] jffs2: Convert jffs2_gcd_mtd kthread into  the iterant API Oleg Nesterov <oleg@redhat.com> - 2015-06-07 01:10 +0200

csiph-web