From patchwork Thu Jan 28 11:40:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirill A. Shutemov" X-Patchwork-Id: 8149761 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7BDE49F1CC for ; Thu, 28 Jan 2016 11:41:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A714F202FE for ; Thu, 28 Jan 2016 11:41:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B358420256 for ; Thu, 28 Jan 2016 11:41:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967541AbcA1Lks (ORCPT ); Thu, 28 Jan 2016 06:40:48 -0500 Received: from mail-wm0-f48.google.com ([74.125.82.48]:34766 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967433AbcA1Lkp (ORCPT ); Thu, 28 Jan 2016 06:40:45 -0500 Received: by mail-wm0-f48.google.com with SMTP id 128so6658858wmz.1 for ; Thu, 28 Jan 2016 03:40:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=U7XTASCAt9I16/qKlxLICSay8WM8rxvZ/vS5wUH0zOA=; b=rOHOFIOOIYM/ZARA0RLquBtCau5dYtbSqXLgO8RJkVFtS6SzO93fRQztTlEw4H6pbd N6VZ4V5YYHMxFcW+q85yzencQdG8Ki0CGsRWj+eh61O3jIw6HosgRukr60wN1YJ38Tjd aoqekG4OncQbQLVRGO8L0znpaXooUZ6Wlkbkcj++5ZTAw3hIRZvpbLb5qQ6gnXBpER3Q Rn75zoXQmkd7k0gipKVin5dawdM3hqaSFv+dy/+23XICBU3EoRuUgbVC2d6qAqC4V++m B2mmslfh/7CBmJcRV3rNkubeJC11TJxsrnQk7Zd/xmPtFs4wEu4lufouF+rZeizj5Uvn DucA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=U7XTASCAt9I16/qKlxLICSay8WM8rxvZ/vS5wUH0zOA=; b=XPaiAujyuB3GcpRnbMPgjaZ4SxlOpA3R9R90fW2t9wpf/fTblCkY68HlISMNXu/rb0 vnuBUkpABZYJeZK4C0lw4NtWzILspP0gP32KB2x2p2qC3lTAXR7n0tqViiQCAAjyzr1G TN0p+I0iphr1M2xePAZ58PsZlR6dJGnnlmf9Yr8Sf6t4DNsrxHPi/rQwIti5fsm50xPX N2rlgZDYmKEYKOJT/KPl87yL9GkgfHPPXNxC3Q22tWVKbGA7FWnSAWRPJ/tomL91FRo8 2WhjMk9/C0bJMCQFp9GA9SX9E5ffNQxHqlcMc8K9nTGc//JfDi64uYZRvQ6MxZQkzAFW v/hg== X-Gm-Message-State: AG10YORDbG/+35CUq3vsgxI3+z3vea+yobx8SMOgY+qUsw6NiKSxgcnSvu5GuOrOcVEXyQ== X-Received: by 10.28.187.67 with SMTP id l64mr2493667wmf.39.1453981244170; Thu, 28 Jan 2016 03:40:44 -0800 (PST) Received: from node.shutemov.name ([37.44.114.124]) by smtp.gmail.com with ESMTPSA id q129sm2493166wmd.14.2016.01.28.03.40.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jan 2016 03:40:43 -0800 (PST) Received: by node.shutemov.name (Postfix, from userid 1000) id 5E0B860439D3; Thu, 28 Jan 2016 13:40:42 +0200 (EET) Date: Thu, 28 Jan 2016 13:40:42 +0200 From: "Kirill A. Shutemov" To: Dmitry Vyukov Cc: Vlastimil Babka , Doug Gilbert , Andrew Morton , David Rientjes , Naoya Horiguchi , "Kirill A. Shutemov" , Shiraz Hashim , "linux-mm@kvack.org" , LKML , Hugh Dickins , Sasha Levin , syzkaller , Kostya Serebryany , Alexander Potapenko , linux-scsi Subject: Re: mm: another VM_BUG_ON_PAGE(PageTail(page)) Message-ID: <20160128114042.GE2396@node.shutemov.name> References: <20160128105136.GD2396@node.shutemov.name> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, Jan 28, 2016 at 11:55:14AM +0100, Dmitry Vyukov wrote: > On Thu, Jan 28, 2016 at 11:51 AM, Kirill A. Shutemov > wrote: > > On Thu, Jan 28, 2016 at 11:27:11AM +0100, Dmitry Vyukov wrote: > >> Hello, > >> > >> The following program triggers VM_BUG_ON_PAGE(PageTail(page)): > >> > >> // autogenerated by syzkaller (http://github.com/google/syzkaller) > >> #include > >> #include > >> #include > >> #include > >> > >> int main() > >> { > >> int fd; > >> > >> mmap((void*)0x20000000, 4096, PROT_READ|PROT_WRITE, > >> MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0); > >> fd = open("/dev/sg1", O_RDONLY|O_SYNC|0x100000); > >> mmap((void*)0x20001000, 0x4000, PROT_READ|PROT_WRITE, > >> MAP_PRIVATE|MAP_FIXED, fd, 0); > >> mbind((void*)0x20000000, 0x4000, 0x8002, (void*)0x20002ff8, 3660, > >> MPOL_MF_STRICT|MPOL_MF_MOVE); > >> return 0; > >> } > > > > I don't have sg1 in my VM. I changed it to sg0 and it doesn't trigger an > > issue: mbind() returns -EINVAL as it supposed to. Hm.. > > I've attached my config, and here is how I start qemu: > > qemu-system-x86_64 -hda wheezy.img -net > user,host=10.0.2.10,hostfwd=tcp::10022-:22 -net nic -nographic -kernel > arch/x86/boot/bzImage -append "console=ttyS0 root=/dev/sda debug > earlyprintk=serial slub_debug=UZ" -enable-kvm -pidfile vm_pid -m 2G > -numa node,nodeid=0,cpus=0-1 -numa node,nodeid=1,cpus=2-3 -smp > sockets=2,cores=2,threads=1 -usb -usbdevice mouse -usbdevice tablet > -soundhw all Still no luck. :-/ Could you try patch below. I want to see what vm_flags are. diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 27d135408a22..93edf181f88a 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -548,8 +548,10 @@ retry: goto retry; } - if (flags & (MPOL_MF_MOVE | MPOL_MF_MOVE_ALL)) + if (flags & (MPOL_MF_MOVE | MPOL_MF_MOVE_ALL)) { + VM_BUG_ON_VMA(PageTail(page), vma); migrate_page_add(page, qp->pagelist, flags); + } } pte_unmap_unlock(pte - 1, ptl); cond_resched();