From: kbuild test robot <lkp@intel.com>
To: David Rientjes <rientjes@google.com>
Cc: kbuild-all@01.org, "Andrew Morton" <akpm@linux-foundation.org>,
"Michal Hocko" <mhocko@suse.com>,
"Andrea Arcangeli" <aarcange@redhat.com>,
"Benjamin Herrenschmidt" <benh@kernel.crashing.org>,
"Paul Mackerras" <paulus@samba.org>,
"Oded Gabbay" <oded.gabbay@gmail.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"David Airlie" <airlied@linux.ie>,
"Joerg Roedel" <joro@8bytes.org>,
"Doug Ledford" <dledford@redhat.com>,
"Jani Nikula" <jani.nikula@linux.intel.com>,
"Mike Marciniszyn" <mike.marciniszyn@intel.com>,
"Sean Hefty" <sean.hefty@intel.com>,
"Dimitri Sivanich" <sivanich@sgi.com>,
"Boris Ostrovsky" <boris.ostrovsky@oracle.com>,
"Jérôme Glisse" <jglisse@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Radim Krčmář" <rkrcmar@redhat.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [patch 1/2] mm, mmu_notifier: annotate mmu notifiers with blockable invalidate callbacks
Date: Thu, 14 Dec 2017 20:46:24 +0800 [thread overview]
Message-ID: <201712142049.Qx3fiVE3%fengguang.wu@intel.com> (raw)
In-Reply-To: <alpine.DEB.2.10.1712111409090.196232@chino.kir.corp.google.com>
[-- Attachment #1: Type: text/plain, Size: 5272 bytes --]
Hi David,
I love your patch! Yet something to improve:
[auto build test ERROR on drm/drm-next]
[also build test ERROR on v4.15-rc3 next-20171214]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/David-Rientjes/mm-mmu_notifier-annotate-mmu-notifiers-with-blockable-invalidate-callbacks/20171214-173044
base: git://people.freedesktop.org/~airlied/linux.git drm-next
config: powerpc-defconfig (attached as .config)
compiler: powerpc64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=powerpc
All errors (new ones prefixed by >>):
arch/powerpc/platforms/powernv/npu-dma.c: In function 'pnv_npu2_init_context':
>> arch/powerpc/platforms/powernv/npu-dma.c:713:3: error: 'npu_content' undeclared (first use in this function); did you mean 'npu_context'?
npu_content->mn.flags = MMU_INVALIDATE_MAY_BLOCK;
^~~~~~~~~~~
npu_context
arch/powerpc/platforms/powernv/npu-dma.c:713:3: note: each undeclared identifier is reported only once for each function it appears in
vim +713 arch/powerpc/platforms/powernv/npu-dma.c
639
640 /*
641 * Call into OPAL to setup the nmmu context for the current task in
642 * the NPU. This must be called to setup the context tables before the
643 * GPU issues ATRs. pdev should be a pointed to PCIe GPU device.
644 *
645 * A release callback should be registered to allow a device driver to
646 * be notified that it should not launch any new translation requests
647 * as the final TLB invalidate is about to occur.
648 *
649 * Returns an error if there no contexts are currently available or a
650 * npu_context which should be passed to pnv_npu2_handle_fault().
651 *
652 * mmap_sem must be held in write mode.
653 */
654 struct npu_context *pnv_npu2_init_context(struct pci_dev *gpdev,
655 unsigned long flags,
656 struct npu_context *(*cb)(struct npu_context *, void *),
657 void *priv)
658 {
659 int rc;
660 u32 nvlink_index;
661 struct device_node *nvlink_dn;
662 struct mm_struct *mm = current->mm;
663 struct pnv_phb *nphb;
664 struct npu *npu;
665 struct npu_context *npu_context;
666
667 /*
668 * At present we don't support GPUs connected to multiple NPUs and I'm
669 * not sure the hardware does either.
670 */
671 struct pci_dev *npdev = pnv_pci_get_npu_dev(gpdev, 0);
672
673 if (!firmware_has_feature(FW_FEATURE_OPAL))
674 return ERR_PTR(-ENODEV);
675
676 if (!npdev)
677 /* No nvlink associated with this GPU device */
678 return ERR_PTR(-ENODEV);
679
680 if (!mm || mm->context.id == 0) {
681 /*
682 * Kernel thread contexts are not supported and context id 0 is
683 * reserved on the GPU.
684 */
685 return ERR_PTR(-EINVAL);
686 }
687
688 nphb = pci_bus_to_host(npdev->bus)->private_data;
689 npu = &nphb->npu;
690
691 /*
692 * Setup the NPU context table for a particular GPU. These need to be
693 * per-GPU as we need the tables to filter ATSDs when there are no
694 * active contexts on a particular GPU.
695 */
696 rc = opal_npu_init_context(nphb->opal_id, mm->context.id, flags,
697 PCI_DEVID(gpdev->bus->number, gpdev->devfn));
698 if (rc < 0)
699 return ERR_PTR(-ENOSPC);
700
701 /*
702 * We store the npu pci device so we can more easily get at the
703 * associated npus.
704 */
705 npu_context = mm->context.npu_context;
706 if (!npu_context) {
707 npu_context = kzalloc(sizeof(struct npu_context), GFP_KERNEL);
708 if (!npu_context)
709 return ERR_PTR(-ENOMEM);
710
711 mm->context.npu_context = npu_context;
712 npu_context->mm = mm;
> 713 npu_content->mn.flags = MMU_INVALIDATE_MAY_BLOCK;
714 npu_context->mn.ops = &nv_nmmu_notifier_ops;
715 __mmu_notifier_register(&npu_context->mn, mm);
716 kref_init(&npu_context->kref);
717 } else {
718 kref_get(&npu_context->kref);
719 }
720
721 npu_context->release_cb = cb;
722 npu_context->priv = priv;
723 nvlink_dn = of_parse_phandle(npdev->dev.of_node, "ibm,nvlink", 0);
724 if (WARN_ON(of_property_read_u32(nvlink_dn, "ibm,npu-link-index",
725 &nvlink_index)))
726 return ERR_PTR(-ENODEV);
727 npu_context->npdev[npu->index][nvlink_index] = npdev;
728
729 if (!nphb->npu.nmmu_flush) {
730 /*
731 * If we're not explicitly flushing ourselves we need to mark
732 * the thread for global flushes
733 */
734 npu_context->nmmu_flush = false;
735 mm_context_add_copro(mm);
736 } else
737 npu_context->nmmu_flush = true;
738
739 return npu_context;
740 }
741 EXPORT_SYMBOL(pnv_npu2_init_context);
742
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 24072 bytes --]
next prev parent reply other threads:[~2017-12-14 12:47 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-11 22:11 David Rientjes
2017-12-11 22:11 ` [patch 2/2] mm, oom: avoid reaping only for mm's " David Rientjes
2017-12-11 22:23 ` [patch 1/2] mm, mmu_notifier: annotate mmu notifiers " Paolo Bonzini
2017-12-11 23:09 ` David Rientjes
2017-12-12 20:05 ` Dimitri Sivanich
2017-12-12 21:28 ` David Rientjes
2017-12-13 9:34 ` Christian König
2017-12-13 10:26 ` Tetsuo Handa
2017-12-13 10:37 ` Paolo Bonzini
2017-12-14 9:19 ` David Rientjes
2017-12-14 12:46 ` kbuild test robot [this message]
2017-12-14 21:30 ` [patch v2 " David Rientjes
2017-12-14 21:31 ` [patch v2 2/2] mm, oom: avoid reaping only for mm's " David Rientjes
2017-12-15 16:35 ` Michal Hocko
2017-12-15 21:46 ` David Rientjes
2017-12-15 8:42 ` [patch v2 1/2] mm, mmu_notifier: annotate mmu notifiers " Paolo Bonzini
2017-12-15 12:19 ` Christian König
2017-12-15 13:36 ` Dimitri Sivanich
2017-12-15 16:25 ` Michal Hocko
2017-12-16 6:21 ` Tetsuo Handa
2017-12-16 11:33 ` Michal Hocko
2017-12-15 23:04 ` Andrew Morton
2017-12-16 7:14 ` Tetsuo Handa
2017-12-16 11:36 ` Michal Hocko
2017-12-16 14:45 ` Tetsuo Handa
2017-12-16 9:10 ` Michal Hocko
2018-01-09 21:40 ` [patch -mm] mm, mmu_notifier: annotate mmu notifiers with blockable invalidate callbacks fix fix David Rientjes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201712142049.Qx3fiVE3%fengguang.wu@intel.com \
--to=lkp@intel.com \
--cc=aarcange@redhat.com \
--cc=airlied@linux.ie \
--cc=akpm@linux-foundation.org \
--cc=alexander.deucher@amd.com \
--cc=benh@kernel.crashing.org \
--cc=boris.ostrovsky@oracle.com \
--cc=christian.koenig@amd.com \
--cc=dledford@redhat.com \
--cc=jani.nikula@linux.intel.com \
--cc=jglisse@redhat.com \
--cc=joro@8bytes.org \
--cc=kbuild-all@01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=mike.marciniszyn@intel.com \
--cc=oded.gabbay@gmail.com \
--cc=paulus@samba.org \
--cc=pbonzini@redhat.com \
--cc=rientjes@google.com \
--cc=rkrcmar@redhat.com \
--cc=sean.hefty@intel.com \
--cc=sivanich@sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox