From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx133.postini.com [74.125.245.133]) by kanga.kvack.org (Postfix) with SMTP id 28D3D6B007B for ; Thu, 29 Nov 2012 19:28:54 -0500 (EST) Date: Fri, 30 Nov 2012 08:28:48 +0800 From: Fengguang Wu Subject: [memcg:since-3.6 341/499] drivers/virtio/virtio_balloon.c:157:2-8: preceding lock on line 136 Message-ID: <20121130002848.GA28177@localhost> References: <50b79f52.Rxsdi7iwHf+1mkK5%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50b79f52.Rxsdi7iwHf+1mkK5%fengguang.wu@intel.com> Sender: owner-linux-mm@kvack.org List-ID: To: Rafael Aquini Cc: kbuild@01.org, Julia Lawall , Michal Hocko , Andrew Morton , linux-mm@kvack.org Hi Rafael, [Julia and me think that this coccinelle warning is worth reporting.] tree: git://git.kernel.org/pub/scm/linux/kernel/git/mhocko/mm.git since-3.6 head: 422a0f651b5cefa1b6b3ede2e1c9e540a24a6e01 commit: 5f1da4063294480b3fabcee554f976565dec54b5 [341/499] virtio_balloon: introduce migration primitives to balloon pages + drivers/virtio/virtio_balloon.c:157:2-8: preceding lock on line 136 vim +157 drivers/virtio/virtio_balloon.c 6b35e407 Rusty Russell 2008-02-04 130 { 5f1da406 Rafael Aquini 2012-11-09 131 struct balloon_dev_info *vb_dev_info = vb->vb_dev_info; 5f1da406 Rafael Aquini 2012-11-09 132 6b35e407 Rusty Russell 2008-02-04 133 /* We can only do one array worth at a time. */ 6b35e407 Rusty Russell 2008-02-04 134 num = min(num, ARRAY_SIZE(vb->pfns)); 6b35e407 Rusty Russell 2008-02-04 135 5f1da406 Rafael Aquini 2012-11-09 @136 mutex_lock(&vb->balloon_lock); 3ccc9372 Michael S. Tsirkin 2012-04-12 137 for (vb->num_pfns = 0; vb->num_pfns < num; 3ccc9372 Michael S. Tsirkin 2012-04-12 138 vb->num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE) { 5f1da406 Rafael Aquini 2012-11-09 139 struct page *page = balloon_page_enqueue(vb_dev_info); 5f1da406 Rafael Aquini 2012-11-09 140 6b35e407 Rusty Russell 2008-02-04 141 if (!page) { 6b35e407 Rusty Russell 2008-02-04 142 if (printk_ratelimit()) 6b35e407 Rusty Russell 2008-02-04 143 dev_printk(KERN_INFO, &vb->vdev->dev, 6b35e407 Rusty Russell 2008-02-04 144 "Out of puff! Can't get %zu pages\n", 5f1da406 Rafael Aquini 2012-11-09 145 VIRTIO_BALLOON_PAGES_PER_PAGE); 6b35e407 Rusty Russell 2008-02-04 146 /* Sleep for at least 1/5 of a second before retry. */ 6b35e407 Rusty Russell 2008-02-04 147 msleep(200); 6b35e407 Rusty Russell 2008-02-04 148 break; 6b35e407 Rusty Russell 2008-02-04 149 } 3ccc9372 Michael S. Tsirkin 2012-04-12 150 set_page_pfns(vb->pfns + vb->num_pfns, page); 3ccc9372 Michael S. Tsirkin 2012-04-12 151 vb->num_pages += VIRTIO_BALLOON_PAGES_PER_PAGE; 6b35e407 Rusty Russell 2008-02-04 152 totalram_pages--; 6b35e407 Rusty Russell 2008-02-04 153 } 6b35e407 Rusty Russell 2008-02-04 154 6b35e407 Rusty Russell 2008-02-04 155 /* Didn't get any? Oh well. */ 6b35e407 Rusty Russell 2008-02-04 156 if (vb->num_pfns == 0) 6b35e407 Rusty Russell 2008-02-04 @157 return; 6b35e407 Rusty Russell 2008-02-04 158 6b35e407 Rusty Russell 2008-02-04 159 tell_host(vb, vb->inflate_vq); 5f1da406 Rafael Aquini 2012-11-09 160 mutex_unlock(&vb->balloon_lock); --- 0-DAY kernel build testing backend Open Source Technology Center Fengguang Wu, Yuanhan Liu Intel Corporation -- 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/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx163.postini.com [74.125.245.163]) by kanga.kvack.org (Postfix) with SMTP id 235D16B0074 for ; Thu, 29 Nov 2012 19:46:18 -0500 (EST) Date: Thu, 29 Nov 2012 16:46:16 -0800 From: Andrew Morton Subject: Re: [memcg:since-3.6 341/499] drivers/virtio/virtio_balloon.c:157:2-8: preceding lock on line 136 Message-Id: <20121129164616.6c308ce0.akpm@linux-foundation.org> In-Reply-To: <20121130002848.GA28177@localhost> References: <50b79f52.Rxsdi7iwHf+1mkK5%fengguang.wu@intel.com> <20121130002848.GA28177@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Fengguang Wu Cc: Rafael Aquini , kbuild@01.org, Julia Lawall , Michal Hocko , linux-mm@kvack.org On Fri, 30 Nov 2012 08:28:48 +0800 Fengguang Wu wrote: > Hi Rafael, > > [Julia and me think that this coccinelle warning is worth reporting.] > > tree: git://git.kernel.org/pub/scm/linux/kernel/git/mhocko/mm.git since-3.6 > head: 422a0f651b5cefa1b6b3ede2e1c9e540a24a6e01 > commit: 5f1da4063294480b3fabcee554f976565dec54b5 [341/499] virtio_balloon: introduce migration primitives to balloon pages > > + drivers/virtio/virtio_balloon.c:157:2-8: preceding lock on line 136 > > vim +157 drivers/virtio/virtio_balloon.c > > 6b35e407 Rusty Russell 2008-02-04 130 { > 5f1da406 Rafael Aquini 2012-11-09 131 struct balloon_dev_info *vb_dev_info = vb->vb_dev_info; > 5f1da406 Rafael Aquini 2012-11-09 132 > 6b35e407 Rusty Russell 2008-02-04 133 /* We can only do one array worth at a time. */ > 6b35e407 Rusty Russell 2008-02-04 134 num = min(num, ARRAY_SIZE(vb->pfns)); > 6b35e407 Rusty Russell 2008-02-04 135 > 5f1da406 Rafael Aquini 2012-11-09 @136 mutex_lock(&vb->balloon_lock); > 3ccc9372 Michael S. Tsirkin 2012-04-12 137 for (vb->num_pfns = 0; vb->num_pfns < num; > 3ccc9372 Michael S. Tsirkin 2012-04-12 138 vb->num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE) { > 5f1da406 Rafael Aquini 2012-11-09 139 struct page *page = balloon_page_enqueue(vb_dev_info); > 5f1da406 Rafael Aquini 2012-11-09 140 > 6b35e407 Rusty Russell 2008-02-04 141 if (!page) { > 6b35e407 Rusty Russell 2008-02-04 142 if (printk_ratelimit()) > 6b35e407 Rusty Russell 2008-02-04 143 dev_printk(KERN_INFO, &vb->vdev->dev, > 6b35e407 Rusty Russell 2008-02-04 144 "Out of puff! Can't get %zu pages\n", > 5f1da406 Rafael Aquini 2012-11-09 145 VIRTIO_BALLOON_PAGES_PER_PAGE); > 6b35e407 Rusty Russell 2008-02-04 146 /* Sleep for at least 1/5 of a second before retry. */ > 6b35e407 Rusty Russell 2008-02-04 147 msleep(200); > 6b35e407 Rusty Russell 2008-02-04 148 break; > 6b35e407 Rusty Russell 2008-02-04 149 } > 3ccc9372 Michael S. Tsirkin 2012-04-12 150 set_page_pfns(vb->pfns + vb->num_pfns, page); > 3ccc9372 Michael S. Tsirkin 2012-04-12 151 vb->num_pages += VIRTIO_BALLOON_PAGES_PER_PAGE; > 6b35e407 Rusty Russell 2008-02-04 152 totalram_pages--; > 6b35e407 Rusty Russell 2008-02-04 153 } > 6b35e407 Rusty Russell 2008-02-04 154 > 6b35e407 Rusty Russell 2008-02-04 155 /* Didn't get any? Oh well. */ > 6b35e407 Rusty Russell 2008-02-04 156 if (vb->num_pfns == 0) > 6b35e407 Rusty Russell 2008-02-04 @157 return; > 6b35e407 Rusty Russell 2008-02-04 158 > 6b35e407 Rusty Russell 2008-02-04 159 tell_host(vb, vb->inflate_vq); > 5f1da406 Rafael Aquini 2012-11-09 160 mutex_unlock(&vb->balloon_lock); This bug was fixed by virtio_balloon-introduce-migration-primitives-to-balloon-pages.patch this one -> virtio_balloon-introduce-migration-primitives-to-balloon-pages-fix.patch virtio_balloon-introduce-migration-primitives-to-balloon-pages-fix-fix.patch virtio_balloon-introduce-migration-primitives-to-balloon-pages-fix-fix-fix.patch I'm surprised this sort of thing hasn't occurred before now - I'd assumed that your bisection system knew about the followup patches and skipped them. I wonder how hard this is to do. My naming scheme is pretty simple: foo-bar-zot.patch foo-bar-zot-[some-other-text].patch foo-bar-zot-[some-different-other-text].patch But those are the local-to-mm filenames. The Subject: field in the linux-next commit is sometimes quite different from the original filename. But I can stop doing that, and ensure that the Subject: matches the filename for fixup patches. That means that your are-there-any-fixup-patches logic would need to do this: - Look at the patch title, For example, "virtio_balloon: introduce migration primitives to balloon pages". - Mangle that title into an akpm patch filename. The dopey script I use to do this is below. In this example it will yield virtio_balloon-introduce-migration-primitives-to-balloon-pages - Look at the Subject: field of the following patches. If they start with virtio_balloon-introduce-migration-primitives-to-balloon-pages then skip over them. #!/bin/sh . patchfns 2>/dev/null || . /usr/lib/patch-scripts/patchfns 2>/dev/null || . $PATCHSCRIPTS_LIBDIR/patchfns 2>/dev/null || { echo "Impossible to find my library 'patchfns'." echo "Check your install, or go to the right directory" exit 1 } line="$1" if stripit $line 2>/dev/null > /dev/null then f=$(stripit $line) if [ -e txt/$f.txt ] then line="$(grep "^Subject: " txt/$f.txt | head -n 1)" line=$(echo $line | sed -e "s/^Subject: //") fi fi line=$(echo "$line" | tr 'A-Z' 'a-z') line=$(echo "$line" | sed -e 's/^subject:[ ]*//') line=$(echo "$line" | sed -e 's/^fw:[ ]*//') line=$(echo "$line" | sed -e 's/(fwd)//g') line=$(echo "$line" | sed -e 's/^fwd:[ ]*//') line=$(echo "$line" | sed -e 's/^aw:[ ]*//') line=$(echo "$line" | sed -e 's/^re:[ ]*//') line=$(echo "$line" | sed -e 's/^patch//') line=$(echo "$line" | sed -e "s/['\(\)\<\>\{\}\,\.\\]//g") line=$(echo "$line" | sed -e "s/[\#\*\&\+\^\!\~\`\|\?\;]//g") line=$(echo "$line" | sed -e "s/[\$]//g") line=$(echo "$line" | sed -e 's/"//g') line=$(echo "$line" | sed -e 's/^[-]*//g') line=$(echo "$line" | sed -e 's/\[[^]]*\]//g') line=$(echo "$line" | sed -e 's/[ ]*\[patch\][ ]*//') line=$(echo "$line" | sed -e 's/\[//g') line=$(echo "$line" | sed -e 's/\]//g') line=$(echo "$line" | sed -e 's/^[ ]*//') line=$(echo "$line" | sed -e 's/ -/-/g') line=$(echo "$line" | sed -e 's/@/-/g') line=$(echo "$line" | sed -e 's/- /-/g') line=$(echo "$line" | sed -e 's/[ ][ ]*/-/g') line=$(echo "$line" | sed -e 's,/,-,g') line=$(echo "$line" | sed -e 's/--/-/g') line=$(echo "$line" | sed -e 's/-$//g') line=$(echo "$line" | sed -e 's/^-//g') line=$(echo "$line" | sed -e 's/:/-/g') line=$(echo "$line" | sed -e 's/--/-/g') line=$(echo "$line" | sed -e 's/--/-/g') line=$(echo "$line" | sed -e 's/--/-/g') line=$(echo "$line" | sed -e 's/^[-]//') line=$(echo "$line" | sed -e 's/[-]$//') line=$(echo "$line" | sed -e 's/[-]$//') line=$(echo "$line" | sed -e 's/[-]$//') echo "$line" -- 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/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx120.postini.com [74.125.245.120]) by kanga.kvack.org (Postfix) with SMTP id 448976B0044 for ; Thu, 29 Nov 2012 21:00:22 -0500 (EST) Date: Fri, 30 Nov 2012 10:00:15 +0800 From: Fengguang Wu Subject: Re: [memcg:since-3.6 341/499] drivers/virtio/virtio_balloon.c:157:2-8: preceding lock on line 136 Message-ID: <20121130020015.GA29687@localhost> References: <50b79f52.Rxsdi7iwHf+1mkK5%fengguang.wu@intel.com> <20121130002848.GA28177@localhost> <20121129164616.6c308ce0.akpm@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20121129164616.6c308ce0.akpm@linux-foundation.org> Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton Cc: Rafael Aquini , kbuild@01.org, Julia Lawall , Michal Hocko , linux-mm@kvack.org On Thu, Nov 29, 2012 at 04:46:16PM -0800, Andrew Morton wrote: > On Fri, 30 Nov 2012 08:28:48 +0800 > Fengguang Wu wrote: > > > Hi Rafael, > > > > [Julia and me think that this coccinelle warning is worth reporting.] > > > > tree: git://git.kernel.org/pub/scm/linux/kernel/git/mhocko/mm.git since-3.6 > > head: 422a0f651b5cefa1b6b3ede2e1c9e540a24a6e01 > > commit: 5f1da4063294480b3fabcee554f976565dec54b5 [341/499] virtio_balloon: introduce migration primitives to balloon pages > > > > + drivers/virtio/virtio_balloon.c:157:2-8: preceding lock on line 136 > > > > vim +157 drivers/virtio/virtio_balloon.c > > > > 6b35e407 Rusty Russell 2008-02-04 130 { > > 5f1da406 Rafael Aquini 2012-11-09 131 struct balloon_dev_info *vb_dev_info = vb->vb_dev_info; > > 5f1da406 Rafael Aquini 2012-11-09 132 > > 6b35e407 Rusty Russell 2008-02-04 133 /* We can only do one array worth at a time. */ > > 6b35e407 Rusty Russell 2008-02-04 134 num = min(num, ARRAY_SIZE(vb->pfns)); > > 6b35e407 Rusty Russell 2008-02-04 135 > > 5f1da406 Rafael Aquini 2012-11-09 @136 mutex_lock(&vb->balloon_lock); > > 3ccc9372 Michael S. Tsirkin 2012-04-12 137 for (vb->num_pfns = 0; vb->num_pfns < num; > > 3ccc9372 Michael S. Tsirkin 2012-04-12 138 vb->num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE) { > > 5f1da406 Rafael Aquini 2012-11-09 139 struct page *page = balloon_page_enqueue(vb_dev_info); > > 5f1da406 Rafael Aquini 2012-11-09 140 > > 6b35e407 Rusty Russell 2008-02-04 141 if (!page) { > > 6b35e407 Rusty Russell 2008-02-04 142 if (printk_ratelimit()) > > 6b35e407 Rusty Russell 2008-02-04 143 dev_printk(KERN_INFO, &vb->vdev->dev, > > 6b35e407 Rusty Russell 2008-02-04 144 "Out of puff! Can't get %zu pages\n", > > 5f1da406 Rafael Aquini 2012-11-09 145 VIRTIO_BALLOON_PAGES_PER_PAGE); > > 6b35e407 Rusty Russell 2008-02-04 146 /* Sleep for at least 1/5 of a second before retry. */ > > 6b35e407 Rusty Russell 2008-02-04 147 msleep(200); > > 6b35e407 Rusty Russell 2008-02-04 148 break; > > 6b35e407 Rusty Russell 2008-02-04 149 } > > 3ccc9372 Michael S. Tsirkin 2012-04-12 150 set_page_pfns(vb->pfns + vb->num_pfns, page); > > 3ccc9372 Michael S. Tsirkin 2012-04-12 151 vb->num_pages += VIRTIO_BALLOON_PAGES_PER_PAGE; > > 6b35e407 Rusty Russell 2008-02-04 152 totalram_pages--; > > 6b35e407 Rusty Russell 2008-02-04 153 } > > 6b35e407 Rusty Russell 2008-02-04 154 > > 6b35e407 Rusty Russell 2008-02-04 155 /* Didn't get any? Oh well. */ > > 6b35e407 Rusty Russell 2008-02-04 156 if (vb->num_pfns == 0) > > 6b35e407 Rusty Russell 2008-02-04 @157 return; > > 6b35e407 Rusty Russell 2008-02-04 158 > > 6b35e407 Rusty Russell 2008-02-04 159 tell_host(vb, vb->inflate_vq); > > 5f1da406 Rafael Aquini 2012-11-09 160 mutex_unlock(&vb->balloon_lock); > > This bug was fixed by > > virtio_balloon-introduce-migration-primitives-to-balloon-pages.patch > this one -> virtio_balloon-introduce-migration-primitives-to-balloon-pages-fix.patch > virtio_balloon-introduce-migration-primitives-to-balloon-pages-fix-fix.patch > virtio_balloon-introduce-migration-primitives-to-balloon-pages-fix-fix-fix.patch Michal: your since-3.6 branch somehow missed that followup fix... > I'm surprised this sort of thing hasn't occurred before now - I'd > assumed that your bisection system knew about the followup patches and > skipped them. Sure. I've been detecting and skipping your follow up fixes in the "commit by commit" build test mode and the logic has been working well, which is basically: [[ $(git_commit_subject $commit) =~ (fix|build|error|warning) ]] && return 0 [[ $(git_commit_changelog $commit) =~ (build|compile|gcc|sparse|smatch|coccinelle|error|warning) ]] && return 0 Note that it's perfectly fine for the above logic to have false positives. If ever a commit (which introduces a build error) is skipped due to being falsely recognized as some followup fix, the build error will still be detected in the next commit (or eventually, in the HEAD which will always be build tested). bisect will then be auto started and locate the error back to the skipped commit. Note that the build system also runs a "check HEAD + bisect errors" mode for some cases, in which it's not necessary to detect possible fixup patches during bisect. Because if ever there is a working fix, the error won't be able to show up in the branch HEAD at all, thus bisect won't be started in the first place. > I wonder how hard this is to do. My naming scheme is pretty simple: > > foo-bar-zot.patch > foo-bar-zot-[some-other-text].patch > foo-bar-zot-[some-different-other-text].patch > > But those are the local-to-mm filenames. The Subject: field in the > linux-next commit is sometimes quite different from the original > filename. But I can stop doing that, and ensure that the Subject: > matches the filename for fixup patches. I simply picked up the keyword "fix" in your typical name scheme "XXXXXX-fix" ;-) > That means that your are-there-any-fixup-patches logic would need to do > this: > > - Look at the patch title, For example, "virtio_balloon: introduce > migration primitives to balloon pages". > > - Mangle that title into an akpm patch filename. The dopey script I > use to do this is below. In this example it will yield > virtio_balloon-introduce-migration-primitives-to-balloon-pages > > - Look at the Subject: field of the following patches. If they start > with virtio_balloon-introduce-migration-primitives-to-balloon-pages > then skip over them. > Thanks for sharing the code and howto! It won't be hard for me to follow that rule, however it seems a bit more straightforward to detect the "fix" magic keyword in the subject line? Thanks, Fengguang > #!/bin/sh > . patchfns 2>/dev/null || > . /usr/lib/patch-scripts/patchfns 2>/dev/null || > . $PATCHSCRIPTS_LIBDIR/patchfns 2>/dev/null || > { > echo "Impossible to find my library 'patchfns'." > echo "Check your install, or go to the right directory" > exit 1 > } > > > line="$1" > if stripit $line 2>/dev/null > /dev/null > then > f=$(stripit $line) > if [ -e txt/$f.txt ] > then > line="$(grep "^Subject: " txt/$f.txt | head -n 1)" > line=$(echo $line | sed -e "s/^Subject: //") > fi > fi > > line=$(echo "$line" | tr 'A-Z' 'a-z') > line=$(echo "$line" | sed -e 's/^subject:[ ]*//') > line=$(echo "$line" | sed -e 's/^fw:[ ]*//') > line=$(echo "$line" | sed -e 's/(fwd)//g') > line=$(echo "$line" | sed -e 's/^fwd:[ ]*//') > line=$(echo "$line" | sed -e 's/^aw:[ ]*//') > line=$(echo "$line" | sed -e 's/^re:[ ]*//') > > line=$(echo "$line" | sed -e 's/^patch//') > line=$(echo "$line" | sed -e "s/['\(\)\<\>\{\}\,\.\\]//g") > line=$(echo "$line" | sed -e "s/[\#\*\&\+\^\!\~\`\|\?\;]//g") > line=$(echo "$line" | sed -e "s/[\$]//g") > line=$(echo "$line" | sed -e 's/"//g') > line=$(echo "$line" | sed -e 's/^[-]*//g') > line=$(echo "$line" | sed -e 's/\[[^]]*\]//g') > line=$(echo "$line" | sed -e 's/[ ]*\[patch\][ ]*//') > line=$(echo "$line" | sed -e 's/\[//g') > line=$(echo "$line" | sed -e 's/\]//g') > line=$(echo "$line" | sed -e 's/^[ ]*//') > line=$(echo "$line" | sed -e 's/ -/-/g') > line=$(echo "$line" | sed -e 's/@/-/g') > line=$(echo "$line" | sed -e 's/- /-/g') > line=$(echo "$line" | sed -e 's/[ ][ ]*/-/g') > line=$(echo "$line" | sed -e 's,/,-,g') > line=$(echo "$line" | sed -e 's/--/-/g') > line=$(echo "$line" | sed -e 's/-$//g') > line=$(echo "$line" | sed -e 's/^-//g') > line=$(echo "$line" | sed -e 's/:/-/g') > > line=$(echo "$line" | sed -e 's/--/-/g') > line=$(echo "$line" | sed -e 's/--/-/g') > line=$(echo "$line" | sed -e 's/--/-/g') > line=$(echo "$line" | sed -e 's/^[-]//') > > line=$(echo "$line" | sed -e 's/[-]$//') > line=$(echo "$line" | sed -e 's/[-]$//') > line=$(echo "$line" | sed -e 's/[-]$//') > > > echo "$line" > -- 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/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx173.postini.com [74.125.245.173]) by kanga.kvack.org (Postfix) with SMTP id 389F26B005D for ; Thu, 29 Nov 2012 21:07:39 -0500 (EST) Date: Thu, 29 Nov 2012 18:07:37 -0800 From: Andrew Morton Subject: Re: [memcg:since-3.6 341/499] drivers/virtio/virtio_balloon.c:157:2-8: preceding lock on line 136 Message-Id: <20121129180737.d4b308b6.akpm@linux-foundation.org> In-Reply-To: <20121130020015.GA29687@localhost> References: <50b79f52.Rxsdi7iwHf+1mkK5%fengguang.wu@intel.com> <20121130002848.GA28177@localhost> <20121129164616.6c308ce0.akpm@linux-foundation.org> <20121130020015.GA29687@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Fengguang Wu Cc: Rafael Aquini , kbuild@01.org, Julia Lawall , Michal Hocko , linux-mm@kvack.org On Fri, 30 Nov 2012 10:00:15 +0800 Fengguang Wu wrote: > Thanks for sharing the code and howto! It won't be hard for me to > follow that rule, however it seems a bit more straightforward to > detect the "fix" magic keyword in the subject line? OK, including "fix" is easy ;) -- 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/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx141.postini.com [74.125.245.141]) by kanga.kvack.org (Postfix) with SMTP id 817026B00DC for ; Fri, 30 Nov 2012 13:15:03 -0500 (EST) Received: by mail-ea0-f169.google.com with SMTP id a12so384150eaa.14 for ; Fri, 30 Nov 2012 10:15:01 -0800 (PST) Date: Fri, 30 Nov 2012 19:14:59 +0100 From: Michal Hocko Subject: Re: [memcg:since-3.6 341/499] drivers/virtio/virtio_balloon.c:157:2-8: preceding lock on line 136 Message-ID: <20121130181459.GA20301@dhcp22.suse.cz> References: <50b79f52.Rxsdi7iwHf+1mkK5%fengguang.wu@intel.com> <20121130002848.GA28177@localhost> <20121129164616.6c308ce0.akpm@linux-foundation.org> <20121130020015.GA29687@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20121130020015.GA29687@localhost> Sender: owner-linux-mm@kvack.org List-ID: To: Fengguang Wu Cc: Andrew Morton , Rafael Aquini , kbuild@01.org, Julia Lawall , linux-mm@kvack.org On Fri 30-11-12 10:00:15, Wu Fengguang wrote: > On Thu, Nov 29, 2012 at 04:46:16PM -0800, Andrew Morton wrote: > > On Fri, 30 Nov 2012 08:28:48 +0800 > > Fengguang Wu wrote: > > > > > Hi Rafael, > > > > > > [Julia and me think that this coccinelle warning is worth reporting.] > > > > > > tree: git://git.kernel.org/pub/scm/linux/kernel/git/mhocko/mm.git since-3.6 > > > head: 422a0f651b5cefa1b6b3ede2e1c9e540a24a6e01 > > > commit: 5f1da4063294480b3fabcee554f976565dec54b5 [341/499] virtio_balloon: introduce migration primitives to balloon pages > > > > > > + drivers/virtio/virtio_balloon.c:157:2-8: preceding lock on line 136 > > > > > > vim +157 drivers/virtio/virtio_balloon.c > > > > > > 6b35e407 Rusty Russell 2008-02-04 130 { > > > 5f1da406 Rafael Aquini 2012-11-09 131 struct balloon_dev_info *vb_dev_info = vb->vb_dev_info; > > > 5f1da406 Rafael Aquini 2012-11-09 132 > > > 6b35e407 Rusty Russell 2008-02-04 133 /* We can only do one array worth at a time. */ > > > 6b35e407 Rusty Russell 2008-02-04 134 num = min(num, ARRAY_SIZE(vb->pfns)); > > > 6b35e407 Rusty Russell 2008-02-04 135 > > > 5f1da406 Rafael Aquini 2012-11-09 @136 mutex_lock(&vb->balloon_lock); > > > 3ccc9372 Michael S. Tsirkin 2012-04-12 137 for (vb->num_pfns = 0; vb->num_pfns < num; > > > 3ccc9372 Michael S. Tsirkin 2012-04-12 138 vb->num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE) { > > > 5f1da406 Rafael Aquini 2012-11-09 139 struct page *page = balloon_page_enqueue(vb_dev_info); > > > 5f1da406 Rafael Aquini 2012-11-09 140 > > > 6b35e407 Rusty Russell 2008-02-04 141 if (!page) { > > > 6b35e407 Rusty Russell 2008-02-04 142 if (printk_ratelimit()) > > > 6b35e407 Rusty Russell 2008-02-04 143 dev_printk(KERN_INFO, &vb->vdev->dev, > > > 6b35e407 Rusty Russell 2008-02-04 144 "Out of puff! Can't get %zu pages\n", > > > 5f1da406 Rafael Aquini 2012-11-09 145 VIRTIO_BALLOON_PAGES_PER_PAGE); > > > 6b35e407 Rusty Russell 2008-02-04 146 /* Sleep for at least 1/5 of a second before retry. */ > > > 6b35e407 Rusty Russell 2008-02-04 147 msleep(200); > > > 6b35e407 Rusty Russell 2008-02-04 148 break; > > > 6b35e407 Rusty Russell 2008-02-04 149 } > > > 3ccc9372 Michael S. Tsirkin 2012-04-12 150 set_page_pfns(vb->pfns + vb->num_pfns, page); > > > 3ccc9372 Michael S. Tsirkin 2012-04-12 151 vb->num_pages += VIRTIO_BALLOON_PAGES_PER_PAGE; > > > 6b35e407 Rusty Russell 2008-02-04 152 totalram_pages--; > > > 6b35e407 Rusty Russell 2008-02-04 153 } > > > 6b35e407 Rusty Russell 2008-02-04 154 > > > 6b35e407 Rusty Russell 2008-02-04 155 /* Didn't get any? Oh well. */ > > > 6b35e407 Rusty Russell 2008-02-04 156 if (vb->num_pfns == 0) > > > 6b35e407 Rusty Russell 2008-02-04 @157 return; > > > 6b35e407 Rusty Russell 2008-02-04 158 > > > 6b35e407 Rusty Russell 2008-02-04 159 tell_host(vb, vb->inflate_vq); > > > 5f1da406 Rafael Aquini 2012-11-09 160 mutex_unlock(&vb->balloon_lock); > > > > This bug was fixed by > > > > virtio_balloon-introduce-migration-primitives-to-balloon-pages.patch > > this one -> virtio_balloon-introduce-migration-primitives-to-balloon-pages-fix.patch > > virtio_balloon-introduce-migration-primitives-to-balloon-pages-fix-fix.patch > > virtio_balloon-introduce-migration-primitives-to-balloon-pages-fix-fix-fix.patch > > Michal: your since-3.6 branch somehow missed that followup fix... Hmm strange, I can see all of them in my tree. 72d9876194be9e6f0600ca796b6689a77fce28b7 f920c4f67b892a6b41054c5441ab0d481489c6c9 63db42f4243be26efffc32806990349235619bad merged in mmotm-2012-11-14-17-40 and my mis-merge follow-up 83bb61967444e22100f7c6e2a5f79ffa85b9e981 merged in mmotm-2012-11-26-17-32 All of them should be -- Michal Hocko SUSE Labs -- 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/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx105.postini.com [74.125.245.105]) by kanga.kvack.org (Postfix) with SMTP id 96B056B0073 for ; Fri, 30 Nov 2012 16:44:25 -0500 (EST) Date: Sat, 1 Dec 2012 05:44:18 +0800 From: Fengguang Wu Subject: Re: [memcg:since-3.6 341/499] drivers/virtio/virtio_balloon.c:157:2-8: preceding lock on line 136 Message-ID: <20121130214418.GA20508@localhost> References: <50b79f52.Rxsdi7iwHf+1mkK5%fengguang.wu@intel.com> <20121130002848.GA28177@localhost> <20121129164616.6c308ce0.akpm@linux-foundation.org> <20121130020015.GA29687@localhost> <20121130181459.GA20301@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20121130181459.GA20301@dhcp22.suse.cz> Sender: owner-linux-mm@kvack.org List-ID: To: Michal Hocko Cc: Andrew Morton , Rafael Aquini , kbuild@01.org, Julia Lawall , linux-mm@kvack.org On Fri, Nov 30, 2012 at 07:14:59PM +0100, Michal Hocko wrote: > On Fri 30-11-12 10:00:15, Wu Fengguang wrote: > > On Thu, Nov 29, 2012 at 04:46:16PM -0800, Andrew Morton wrote: > > > On Fri, 30 Nov 2012 08:28:48 +0800 > > > Fengguang Wu wrote: > > > > > > > Hi Rafael, > > > > > > > > [Julia and me think that this coccinelle warning is worth reporting.] > > > > > > > > tree: git://git.kernel.org/pub/scm/linux/kernel/git/mhocko/mm.git since-3.6 > > > > head: 422a0f651b5cefa1b6b3ede2e1c9e540a24a6e01 > > > > commit: 5f1da4063294480b3fabcee554f976565dec54b5 [341/499] virtio_balloon: introduce migration primitives to balloon pages > > > > > > > > + drivers/virtio/virtio_balloon.c:157:2-8: preceding lock on line 136 > > > > > > > > vim +157 drivers/virtio/virtio_balloon.c > > > > > > > > 6b35e407 Rusty Russell 2008-02-04 130 { > > > > 5f1da406 Rafael Aquini 2012-11-09 131 struct balloon_dev_info *vb_dev_info = vb->vb_dev_info; > > > > 5f1da406 Rafael Aquini 2012-11-09 132 > > > > 6b35e407 Rusty Russell 2008-02-04 133 /* We can only do one array worth at a time. */ > > > > 6b35e407 Rusty Russell 2008-02-04 134 num = min(num, ARRAY_SIZE(vb->pfns)); > > > > 6b35e407 Rusty Russell 2008-02-04 135 > > > > 5f1da406 Rafael Aquini 2012-11-09 @136 mutex_lock(&vb->balloon_lock); > > > > 3ccc9372 Michael S. Tsirkin 2012-04-12 137 for (vb->num_pfns = 0; vb->num_pfns < num; > > > > 3ccc9372 Michael S. Tsirkin 2012-04-12 138 vb->num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE) { > > > > 5f1da406 Rafael Aquini 2012-11-09 139 struct page *page = balloon_page_enqueue(vb_dev_info); > > > > 5f1da406 Rafael Aquini 2012-11-09 140 > > > > 6b35e407 Rusty Russell 2008-02-04 141 if (!page) { > > > > 6b35e407 Rusty Russell 2008-02-04 142 if (printk_ratelimit()) > > > > 6b35e407 Rusty Russell 2008-02-04 143 dev_printk(KERN_INFO, &vb->vdev->dev, > > > > 6b35e407 Rusty Russell 2008-02-04 144 "Out of puff! Can't get %zu pages\n", > > > > 5f1da406 Rafael Aquini 2012-11-09 145 VIRTIO_BALLOON_PAGES_PER_PAGE); > > > > 6b35e407 Rusty Russell 2008-02-04 146 /* Sleep for at least 1/5 of a second before retry. */ > > > > 6b35e407 Rusty Russell 2008-02-04 147 msleep(200); > > > > 6b35e407 Rusty Russell 2008-02-04 148 break; > > > > 6b35e407 Rusty Russell 2008-02-04 149 } > > > > 3ccc9372 Michael S. Tsirkin 2012-04-12 150 set_page_pfns(vb->pfns + vb->num_pfns, page); > > > > 3ccc9372 Michael S. Tsirkin 2012-04-12 151 vb->num_pages += VIRTIO_BALLOON_PAGES_PER_PAGE; > > > > 6b35e407 Rusty Russell 2008-02-04 152 totalram_pages--; > > > > 6b35e407 Rusty Russell 2008-02-04 153 } > > > > 6b35e407 Rusty Russell 2008-02-04 154 > > > > 6b35e407 Rusty Russell 2008-02-04 155 /* Didn't get any? Oh well. */ > > > > 6b35e407 Rusty Russell 2008-02-04 156 if (vb->num_pfns == 0) > > > > 6b35e407 Rusty Russell 2008-02-04 @157 return; > > > > 6b35e407 Rusty Russell 2008-02-04 158 > > > > 6b35e407 Rusty Russell 2008-02-04 159 tell_host(vb, vb->inflate_vq); > > > > 5f1da406 Rafael Aquini 2012-11-09 160 mutex_unlock(&vb->balloon_lock); > > > > > > This bug was fixed by > > > > > > virtio_balloon-introduce-migration-primitives-to-balloon-pages.patch > > > this one -> virtio_balloon-introduce-migration-primitives-to-balloon-pages-fix.patch > > > virtio_balloon-introduce-migration-primitives-to-balloon-pages-fix-fix.patch > > > virtio_balloon-introduce-migration-primitives-to-balloon-pages-fix-fix-fix.patch > > > > Michal: your since-3.6 branch somehow missed that followup fix... > > Hmm strange, I can see all of them in my tree. > 72d9876194be9e6f0600ca796b6689a77fce28b7 > f920c4f67b892a6b41054c5441ab0d481489c6c9 > 63db42f4243be26efffc32806990349235619bad Oops.. the fixes are reverted by a later commit 4f2ac849 - /* Did we get any? */ - if (vb->num_pfns != 0) - tell_host(vb, vb->inflate_vq); - mutex_unlock(&vb->balloon_lock); + /* Didn't get any? Oh well. */ (*) + if (vb->num_pfns == 0) (*) + return; + + tell_host(vb, vb->inflate_vq); (*) then we got the coccinelle warning again in the HEAD. Thanks, Fengguang > merged in mmotm-2012-11-14-17-40 > > and my mis-merge follow-up > 83bb61967444e22100f7c6e2a5f79ffa85b9e981 > > merged in mmotm-2012-11-26-17-32 > All of them should be > > -- > Michal Hocko > SUSE Labs -- 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/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx160.postini.com [74.125.245.160]) by kanga.kvack.org (Postfix) with SMTP id 17FCA6B0044 for ; Sun, 2 Dec 2012 05:49:06 -0500 (EST) Received: by mail-ee0-f41.google.com with SMTP id d41so1324190eek.14 for ; Sun, 02 Dec 2012 02:49:04 -0800 (PST) Date: Sun, 2 Dec 2012 11:49:02 +0100 From: Michal Hocko Subject: Re: [memcg:since-3.6 341/499] drivers/virtio/virtio_balloon.c:157:2-8: preceding lock on line 136 Message-ID: <20121202104902.GA4947@dhcp22.suse.cz> References: <50b79f52.Rxsdi7iwHf+1mkK5%fengguang.wu@intel.com> <20121130002848.GA28177@localhost> <20121129164616.6c308ce0.akpm@linux-foundation.org> <20121130020015.GA29687@localhost> <20121130181459.GA20301@dhcp22.suse.cz> <20121130214418.GA20508@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20121130214418.GA20508@localhost> Sender: owner-linux-mm@kvack.org List-ID: To: Fengguang Wu Cc: Andrew Morton , Rafael Aquini , kbuild@01.org, Julia Lawall , linux-mm@kvack.org On Sat 01-12-12 05:44:18, Wu Fengguang wrote: > On Fri, Nov 30, 2012 at 07:14:59PM +0100, Michal Hocko wrote: > > On Fri 30-11-12 10:00:15, Wu Fengguang wrote: > > > On Thu, Nov 29, 2012 at 04:46:16PM -0800, Andrew Morton wrote: > > > > On Fri, 30 Nov 2012 08:28:48 +0800 > > > > Fengguang Wu wrote: > > > > > > > > > Hi Rafael, > > > > > > > > > > [Julia and me think that this coccinelle warning is worth reporting.] > > > > > > > > > > tree: git://git.kernel.org/pub/scm/linux/kernel/git/mhocko/mm.git since-3.6 > > > > > head: 422a0f651b5cefa1b6b3ede2e1c9e540a24a6e01 > > > > > commit: 5f1da4063294480b3fabcee554f976565dec54b5 [341/499] virtio_balloon: introduce migration primitives to balloon pages > > > > > > > > > > + drivers/virtio/virtio_balloon.c:157:2-8: preceding lock on line 136 > > > > > > > > > > vim +157 drivers/virtio/virtio_balloon.c > > > > > > > > > > 6b35e407 Rusty Russell 2008-02-04 130 { > > > > > 5f1da406 Rafael Aquini 2012-11-09 131 struct balloon_dev_info *vb_dev_info = vb->vb_dev_info; > > > > > 5f1da406 Rafael Aquini 2012-11-09 132 > > > > > 6b35e407 Rusty Russell 2008-02-04 133 /* We can only do one array worth at a time. */ > > > > > 6b35e407 Rusty Russell 2008-02-04 134 num = min(num, ARRAY_SIZE(vb->pfns)); > > > > > 6b35e407 Rusty Russell 2008-02-04 135 > > > > > 5f1da406 Rafael Aquini 2012-11-09 @136 mutex_lock(&vb->balloon_lock); > > > > > 3ccc9372 Michael S. Tsirkin 2012-04-12 137 for (vb->num_pfns = 0; vb->num_pfns < num; > > > > > 3ccc9372 Michael S. Tsirkin 2012-04-12 138 vb->num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE) { > > > > > 5f1da406 Rafael Aquini 2012-11-09 139 struct page *page = balloon_page_enqueue(vb_dev_info); > > > > > 5f1da406 Rafael Aquini 2012-11-09 140 > > > > > 6b35e407 Rusty Russell 2008-02-04 141 if (!page) { > > > > > 6b35e407 Rusty Russell 2008-02-04 142 if (printk_ratelimit()) > > > > > 6b35e407 Rusty Russell 2008-02-04 143 dev_printk(KERN_INFO, &vb->vdev->dev, > > > > > 6b35e407 Rusty Russell 2008-02-04 144 "Out of puff! Can't get %zu pages\n", > > > > > 5f1da406 Rafael Aquini 2012-11-09 145 VIRTIO_BALLOON_PAGES_PER_PAGE); > > > > > 6b35e407 Rusty Russell 2008-02-04 146 /* Sleep for at least 1/5 of a second before retry. */ > > > > > 6b35e407 Rusty Russell 2008-02-04 147 msleep(200); > > > > > 6b35e407 Rusty Russell 2008-02-04 148 break; > > > > > 6b35e407 Rusty Russell 2008-02-04 149 } > > > > > 3ccc9372 Michael S. Tsirkin 2012-04-12 150 set_page_pfns(vb->pfns + vb->num_pfns, page); > > > > > 3ccc9372 Michael S. Tsirkin 2012-04-12 151 vb->num_pages += VIRTIO_BALLOON_PAGES_PER_PAGE; > > > > > 6b35e407 Rusty Russell 2008-02-04 152 totalram_pages--; > > > > > 6b35e407 Rusty Russell 2008-02-04 153 } > > > > > 6b35e407 Rusty Russell 2008-02-04 154 > > > > > 6b35e407 Rusty Russell 2008-02-04 155 /* Didn't get any? Oh well. */ > > > > > 6b35e407 Rusty Russell 2008-02-04 156 if (vb->num_pfns == 0) > > > > > 6b35e407 Rusty Russell 2008-02-04 @157 return; > > > > > 6b35e407 Rusty Russell 2008-02-04 158 > > > > > 6b35e407 Rusty Russell 2008-02-04 159 tell_host(vb, vb->inflate_vq); > > > > > 5f1da406 Rafael Aquini 2012-11-09 160 mutex_unlock(&vb->balloon_lock); > > > > > > > > This bug was fixed by > > > > > > > > virtio_balloon-introduce-migration-primitives-to-balloon-pages.patch > > > > this one -> virtio_balloon-introduce-migration-primitives-to-balloon-pages-fix.patch > > > > virtio_balloon-introduce-migration-primitives-to-balloon-pages-fix-fix.patch > > > > virtio_balloon-introduce-migration-primitives-to-balloon-pages-fix-fix-fix.patch > > > > > > Michal: your since-3.6 branch somehow missed that followup fix... > > > > Hmm strange, I can see all of them in my tree. > > 72d9876194be9e6f0600ca796b6689a77fce28b7 > > f920c4f67b892a6b41054c5441ab0d481489c6c9 > > 63db42f4243be26efffc32806990349235619bad > > Oops.. the fixes are reverted by a later commit 4f2ac849 Ohh, I really screwed that revert (this is the second issue already). Sorry about that and especially sorry that I brought more burden on you. I will be more careful next time. Fixed and pushed Thanks a lot! -- Michal Hocko SUSE Labs -- 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/ . Don't email: email@kvack.org