Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5213771imb; Thu, 7 Mar 2019 10:11:34 -0800 (PST) X-Google-Smtp-Source: APXvYqz2lL7cW2i7zo83e7zfPUhsSk5odDwCjkfsRDSzfTrSGhi6u2ae3cQiV1J0QG6wRQP+B1Of X-Received: by 2002:a62:69c3:: with SMTP id e186mr13712578pfc.169.1551982294408; Thu, 07 Mar 2019 10:11:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551982294; cv=none; d=google.com; s=arc-20160816; b=lodakKMEW8EC6IjddTAzXKzYRix+YrDchUWy2lvfJ7EuSsXma4dAifcsILZ+Y86R7J exVpQZJG/Tm1yQUSbNTXHlYqBTowKDPlElhL1QBPCJgWPEpcNn+Gc7v1iOCcWk/O++Fs whfRiGNrhK+Yxg6SButwsTBuV4k3Rhi3I71veyR8tbMRXdopsnqvGXD1mzQas1A5bScT IKbb6kXzzh8lvc/qKdMkMFRWDnL+AaLnx2m+qXuhBS68PWuRkM0S9g+NU+dPVXqb2lsf yfg7K7kyWeGQaz64QvPSa/kEWsMWq11p5lwBmtFCKPa7K5KUYdaxpgNyfhpO9qg1VGz/ x8Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=6ML26gAuNkpA0o7yld0sozDfNGcOzK0Ft31GfxK7gKw=; b=SDmowhVs13IvIJK93ljhGj5PAfjaFUnbc4pR5ynUxD/LGDu0o5aLTFXL1Ii/QH6r0i 93esrbIImoB8oKuvBPebBxqjDXBHrdpWmIrrVfkJ8cTNFT4LrGLNfM2zXnVCK78WS86X TWs4YKoLbDycHjKcAUWr7tTWwoJWc5tmc3Nw7aG/O2R7FmMOS/cMyP0jqLqqulz9+naZ C6NS/v+bTFMxGw3L63ai8MKvShAwq79mQ7D+uQ8UHpv29LREDMqEQuGU3jUWx+P2bmpK AftgC9Pi1A8JYu95q/X2PHXD5QQ5EqYStiUMjwgpkK/GJaMvoRXPm6UwUojeMs/IeEdN ChOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k86si4812790pfj.145.2019.03.07.10.11.19; Thu, 07 Mar 2019 10:11:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726665AbfCGSKM (ORCPT + 99 others); Thu, 7 Mar 2019 13:10:12 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:38476 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726243AbfCGSKL (ORCPT ); Thu, 7 Mar 2019 13:10:11 -0500 Received: from akpm3.svl.corp.google.com (unknown [104.133.8.65]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 282E7C602; Thu, 7 Mar 2019 18:10:11 +0000 (UTC) Date: Thu, 7 Mar 2019 10:10:10 -0800 From: Andrew Morton To: Li RongQing Cc: linux-kernel@vger.kernel.org, Davidlohr Bueso , Dominik Brodowski , Manfred Spraul , Arnd Bergmann Subject: Re: [PATCH] ipc: prevent lockup on alloc_msg and free_msg Message-Id: <20190307101010.919d18394ae43ecf9d2a2212@linux-foundation.org> In-Reply-To: <1551946222-25470-1-git-send-email-lirongqing@baidu.com> References: <1551946222-25470-1-git-send-email-lirongqing@baidu.com> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 7 Mar 2019 16:10:22 +0800 Li RongQing wrote: > From: Li Rongqing > > msgctl10 of ltp triggers the following lockup When CONFIG_KASAN > is enabled on large memory SMP systems, the pages initialization > can take a long time, if msgctl10 requests a huge block memory, > and it will block rcu scheduler, so release cpu actively. > > ... > > Signed-off-by: Zhang Yu > Signed-off-by: Li RongQing This signoff ordering somewhat implies that Zhang Yu was the author. But you added "From: Li Rongqing", so you will be recorded as the patch's author. Is this correct? > --- a/ipc/msgutil.c > +++ b/ipc/msgutil.c > @@ -18,6 +18,7 @@ > #include > #include > #include > +#include > > #include "util.h" > > @@ -72,6 +73,7 @@ static struct msg_msg *alloc_msg(size_t len) > seg->next = NULL; > pseg = &seg->next; > len -= alen; > + cond_resched(); > } This looks OK. > return msg; > @@ -178,5 +180,6 @@ void free_msg(struct msg_msg *msg) > struct msg_msgseg *tmp = seg->next; > kfree(seg); > seg = tmp; > + cond_resched(); > } This does not. mqueue_evict_inode() (at least) calls free_msg() from under spin_lock().