Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753460AbdDLIS1 (ORCPT ); Wed, 12 Apr 2017 04:18:27 -0400 Received: from mx2.suse.de ([195.135.220.15]:56838 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752725AbdDLISY (ORCPT ); Wed, 12 Apr 2017 04:18:24 -0400 Subject: Re: [RFC 5/6] mm, cpuset: always use seqlock when changing task's nodemask To: Hillf Danton , linux-mm@kvack.org References: <20170411140609.3787-1-vbabka@suse.cz> <20170411140609.3787-6-vbabka@suse.cz> <0c2d01d2b364$4eaba920$ec02fb60$@alibaba-inc.com> Cc: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, "'Li Zefan'" , "'Michal Hocko'" , "'Mel Gorman'" , "'David Rientjes'" , "'Christoph Lameter'" , "'Hugh Dickins'" , "'Andrea Arcangeli'" , "'Anshuman Khandual'" , "'Kirill A. Shutemov'" From: Vlastimil Babka Message-ID: <3a978d8c-c5c6-fc5d-cb40-85c7d7811146@suse.cz> Date: Wed, 12 Apr 2017 10:18:21 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <0c2d01d2b364$4eaba920$ec02fb60$@alibaba-inc.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1315 Lines: 45 On 04/12/2017 10:10 AM, Hillf Danton wrote: > On April 11, 2017 10:06 PM Vlastimil Babka wrote: >> >> static void cpuset_change_task_nodemask(struct task_struct *tsk, >> nodemask_t *newmems) >> { >> - bool need_loop; >> - >> task_lock(tsk); >> - /* >> - * Determine if a loop is necessary if another thread is doing >> - * read_mems_allowed_begin(). If at least one node remains unchanged and >> - * tsk does not have a mempolicy, then an empty nodemask will not be >> - * possible when mems_allowed is larger than a word. >> - */ >> - need_loop = task_has_mempolicy(tsk) || >> - !nodes_intersects(*newmems, tsk->mems_allowed); >> >> - if (need_loop) { >> - local_irq_disable(); >> - write_seqcount_begin(&tsk->mems_allowed_seq); >> - } >> + local_irq_disable(); >> + write_seqcount_begin(&tsk->mems_allowed_seq); >> >> - nodes_or(tsk->mems_allowed, tsk->mems_allowed, *newmems); >> mpol_rebind_task(tsk, newmems); >> tsk->mems_allowed = *newmems; >> >> - if (need_loop) { >> - write_seqcount_end(&tsk->mems_allowed_seq); >> - local_irq_enable(); >> - } >> + write_seqcount_end(&tsk->mems_allowed_seq); >> > Doubt if we'd listen irq again. Ugh, thanks for catching this. Looks like my testing config didn't have lockup detectors enabled. >> task_unlock(tsk); >> } >> -- >> 2.12.2 >