From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966202Ab2FBBpb (ORCPT ); Fri, 1 Jun 2012 21:45:31 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:40328 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966188Ab2FBBp3 convert rfc822-to-8bit (ORCPT ); Fri, 1 Jun 2012 21:45:29 -0400 MIME-Version: 1.0 In-Reply-To: References: <20120530163317.GA13189@redhat.com> <20120531005739.GA4532@redhat.com> <20120601023107.GA19445@redhat.com> <20120601161205.GA1918@redhat.com> <20120601171606.GA3794@redhat.com> From: Linus Torvalds Date: Fri, 1 Jun 2012 18:45:07 -0700 X-Google-Sender-Auth: MgjYepTACaQC49TKf5qQ11LrLmw Message-ID: Subject: Re: WARNING: at mm/page-writeback.c:1990 __set_page_dirty_nobuffers+0x13a/0x170() To: Hugh Dickins Cc: Dave Jones , Andrew Morton , Cong Wang , linux-kernel@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 1, 2012 at 3:17 PM, Hugh Dickins wrote: > > +       spin_lock_irqsave(&zone->lock, flags); >        for (page = start_page, pfn = start_pfn; page < end_page; pfn++, >                                                                  page++) { So holding the spinlock (and disabling irqs!) over the whole loop sounds horrible. At the same time, the iterators don't seem to require the spinlock, so it should be possible to just move the lock into the loop, no? Linus From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx104.postini.com [74.125.245.104]) by kanga.kvack.org (Postfix) with SMTP id 415196B004D for ; Fri, 1 Jun 2012 21:45:30 -0400 (EDT) Received: by wgbdt14 with SMTP id dt14so2195391wgb.26 for ; Fri, 01 Jun 2012 18:45:28 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <20120530163317.GA13189@redhat.com> <20120531005739.GA4532@redhat.com> <20120601023107.GA19445@redhat.com> <20120601161205.GA1918@redhat.com> <20120601171606.GA3794@redhat.com> From: Linus Torvalds Date: Fri, 1 Jun 2012 18:45:07 -0700 Message-ID: Subject: Re: WARNING: at mm/page-writeback.c:1990 __set_page_dirty_nobuffers+0x13a/0x170() Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Sender: owner-linux-mm@kvack.org List-ID: To: Hugh Dickins Cc: Dave Jones , Andrew Morton , Cong Wang , linux-kernel@vger.kernel.org, linux-mm@kvack.org On Fri, Jun 1, 2012 at 3:17 PM, Hugh Dickins wrote: > > + =A0 =A0 =A0 spin_lock_irqsave(&zone->lock, flags); > =A0 =A0 =A0 =A0for (page =3D start_page, pfn =3D start_pfn; page < end_pa= ge; pfn++, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0page++) { So holding the spinlock (and disabling irqs!) over the whole loop sounds horrible. At the same time, the iterators don't seem to require the spinlock, so it should be possible to just move the lock into the loop, no? Linus -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org