Re: [PATCH] [PATCH v6] docs-rst: automatically convert Graphviz and SVG images
> Am 13.07.2017 um 22:50 schrieb Mauro Carvalho Chehab > : > > Em Mon, 6 Mar 2017 14:09:27 +0100 > Markus Heiser escreveu: > >> This patch brings scalable figure, image handling and a concept to >> embed *render* markups: >> >> * DOT (http://www.graphviz.org) >> * SVG > > Not sure what's happening here, but, after I upgraded to Fedora 26, > with comes with python 3.6, instead of 3.5, this patch is now > causing build problems (with Sphinx 1.4.9, running on a virtual > environment): Are you sure (only) this patch causes the problem? I remember this was a more general problem which unfortunately pops up in the context of this patch .. > $ make SPHINXDIRS=doc-guide htmldocs > SPHINX htmldocs --> file:///devel/v4l/docs/Documentation/output/doc-guide ... > File > "/devel/v4l/docs/sphinx_1.4/lib/python3.6/site-packages/docutils/writers/_html_base.py", > line 671, in depart_document >assert not self.context, 'len(context) = %s' % len(self.context) > AssertionError: len(context) = 4 SHORT: If one of you see a "AssertionError: len(context) = 4", then update your Sphinx Version LONG: we had already a long ML thread in March about this. Ok, to summarize. The problem here is a chain of problems .. First: there has been a not backward compatible change in the (undocumented?) API in one of Sphinx-doc's dependencies (in docutils 0.13.1). Second: The Sphinx team does not maintain patch levels, see my (return42) request at the Sphinx project: https://github.com/sphinx-doc/sphinx/issues/3212#issuecomment-283756374 Third: distros don't care about such details .. Jon pointed us the LWN article "Package managers all the way down" .. https://lwn.net/Articles/712318/ Back to sphinx .. This error is typical for environments (distros) where a Sphinx 1.4.x is paired with docutils >= 0.13.1 So far I can see, we can only restart the "docutils borkage" thread from Jon & you: https://www.mail-archive.com/linux-doc@vger.kernel.org/msg09874.html -- Markus -- -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] x86/idle: use dynamic halt poll
On 13.07.17 13:49, Yang Zhang wrote: On 2017/7/4 22:13, Radim Krčmář wrote: 2017-07-03 17:28+0800, Yang Zhang: The background is that we(Alibaba Cloud) do get more and more complaints from our customers in both KVM and Xen compare to bare-mental.After investigations, the root cause is known to us: big cost in message passing workload(David show it in KVM forum 2015) A typical message workload like below: vcpu 0 vcpu 1 1. send ipi 2. doing hlt 3. go into idle 4. receive ipi and wake up from hlt 5. write APIC time twice6. write APIC time twice to to stop sched timer reprogram sched timer One write is enough to disable/re-enable the APIC timer -- why does Linux use two? One is to remove the timer and another one is to reprogram the timer. Normally, only one write to remove the timer.But in some cases, it will reprogram it. 7. doing hlt8. handle task and send ipi to vcpu 0 9. same to 4. 10. same to 3 One transaction will introduce about 12 vmexits(2 hlt and 10 msr write). The cost of such vmexits will degrades performance severely. Yeah, sounds like too much ... I understood that there are IPI from 1 to 2 4 * APIC timer IPI from 2 to 1 which adds to 6 MSR writes -- what are the other 4? In the worst case, each timer will touch APIC timer twice.So it will add additional 4 msr writse. But this is not always true. Linux kernel already provide idle=poll to mitigate the trend. But it only eliminates the IPI and hlt vmexit. It has nothing to do with start/stop sched timer. A compromise would be to turn off NOHZ kernel, but it is not the default config for new distributions. Same for halt-poll in KVM, it only solve the cost from schedule in/out in host and can not help such workload much. The purpose of this patch we want to improve current idle=poll mechanism to Please aim to allow MWAIT instead of idle=poll -- MWAIT doesn't slow down the sibling hyperthread. MWAIT solves the IPI problem, but doesn't get rid of the timer one. Yes, i can try it. But MWAIT will not yield CPU, it only helps the sibling hyperthread as you mentioned. If you implement proper MWAIT emulation that conditionally gets en- or disabled depending on the same halt poll dynamics that we already have for in-host HLT handling, it will also yield the CPU. As for the timer - are you sure the problem is really the overhead of the timer configuration, not the latency that it takes to actually fire the guest timer? One major problem I see is that we configure the host hrtimer to fire at the point in time when the guest wants to see a timer event. But in a virtual environment, the point in time when we have to start switching to the VM really should be a bit *before* the guest wants to be woken up, as it takes quite some time to switch back into the VM context. Alex -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] kmemleak: add oom= runtime parameter
From: Shu Wang When running memory stress tests, kmemleak could be easily disabled in function create_object as system is out of memory and kmemleak failed to alloc from object_cache. Since there's no way to enable kmemleak after it's off, simply ignore the object_cache alloc failure will just loses track of some memory objects, but could increase the usability of kmemleak under memory stress. The default action for oom is still disable kmemleak, echo oom=ignore > /sys/kernel/debug/kmemleak can change to action to ignore oom. Signed-off-by: Shu Wang --- Documentation/dev-tools/kmemleak.rst | 5 + mm/kmemleak.c| 10 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Documentation/dev-tools/kmemleak.rst b/Documentation/dev-tools/kmemleak.rst index cb88626..3013809 100644 --- a/Documentation/dev-tools/kmemleak.rst +++ b/Documentation/dev-tools/kmemleak.rst @@ -60,6 +60,11 @@ Memory scanning parameters can be modified at run-time by writing to the or free all kmemleak objects if kmemleak has been disabled. - dump= dump information about the object found at +- oom=disable +disable kmemleak after system out of memory (default) +- oom=ignore +do not disable kmemleak after system out of memory +(useful for memory stress test, but will lose some objects) Kmemleak can also be disabled at boot-time by passing ``kmemleak=off`` on the kernel command line. diff --git a/mm/kmemleak.c b/mm/kmemleak.c index 7780cd8..a58080f 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -236,6 +236,9 @@ static DEFINE_MUTEX(scan_mutex); static int kmemleak_skip_disable; /* If there are leaks that can be reported */ static bool kmemleak_found_leaks; +/* If disable kmemleak after out of memory */ +static bool kmemleak_oom_disable = true; + /* * Early object allocation/freeing logging. Kmemleak is initialized after the @@ -556,7 +559,8 @@ static struct kmemleak_object *create_object(unsigned long ptr, size_t size, object = kmem_cache_alloc(object_cache, gfp_kmemleak_mask(gfp)); if (!object) { pr_warn("Cannot allocate a kmemleak_object structure\n"); - kmemleak_disable(); + if (kmemleak_oom_disable) + kmemleak_disable(); return NULL; } @@ -1888,6 +1892,10 @@ static ssize_t kmemleak_write(struct file *file, const char __user *user_buf, kmemleak_scan(); else if (strncmp(buf, "dump=", 5) == 0) ret = dump_str_object_info(buf + 5); + else if (strncmp(buf, "oom=ignore", 10)) + kmemleak_oom_disable = false; + else if (strncmp(buf, "oom=disable", 11)) + kmemleak_oom_disable = true; else ret = -EINVAL; -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] [PATCH v6] docs-rst: automatically convert Graphviz and SVG images
Em Fri, 14 Jul 2017 09:24:44 +0200 Markus Heiser escreveu: > > Am 13.07.2017 um 22:50 schrieb Mauro Carvalho Chehab > > : > > > > Em Mon, 6 Mar 2017 14:09:27 +0100 > > Markus Heiser escreveu: > > > >> This patch brings scalable figure, image handling and a concept to > >> embed *render* markups: > >> > >> * DOT (http://www.graphviz.org) > >> * SVG > > > > Not sure what's happening here, but, after I upgraded to Fedora 26, > > with comes with python 3.6, instead of 3.5, this patch is now > > causing build problems (with Sphinx 1.4.9, running on a virtual > > environment): > > Are you sure (only) this patch causes the problem? I remember this > was a more general problem which unfortunately pops up in the context > of this patch .. I tested reverting it and everything built in html, but I didn't did a comprehensive testing, nor even check if the output was ok. > > > $ make SPHINXDIRS=doc-guide htmldocs > > SPHINX htmldocs --> file:///devel/v4l/docs/Documentation/output/doc-guide > > > ... > > File > > "/devel/v4l/docs/sphinx_1.4/lib/python3.6/site-packages/docutils/writers/_html_base.py", > > line 671, in depart_document > >assert not self.context, 'len(context) = %s' % len(self.context) > > AssertionError: len(context) = 4 > > > SHORT: If one of you see a "AssertionError: len(context) = 4", >then update your Sphinx Version > > LONG: we had already a long ML thread in March about this. Ah, I remember those discussions with regards to docutils version. Thanks for pointing it to me. > Ok, to summarize. The problem here is a chain of problems .. > > First: there has been a not backward compatible change in the > (undocumented?) API in one of Sphinx-doc's dependencies (in > docutils 0.13.1). Yeah, that's it. Doing a pip install 'docutils==0.12' at the virtual env solved the issue. I guess we should document it somewhere. Thanks, Mauro -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] kmemleak: add oom= runtime parameter
Hi please ignore this patch, I'll upload another one. Thanks - Original Message - > From: shuw...@redhat.com > To: "catalin marinas" , cor...@lwn.net > Cc: linux-doc@vger.kernel.org, linux-ker...@vger.kernel.org, > linux...@kvack.org, liw...@redhat.com, > shuw...@redhat.com, ch...@redhat.com > Sent: Friday, July 14, 2017 5:39:20 PM > Subject: [PATCH] kmemleak: add oom= runtime parameter > > From: Shu Wang > > When running memory stress tests, kmemleak could be easily disabled in > function create_object as system is out of memory and kmemleak failed to > alloc from object_cache. Since there's no way to enable kmemleak after > it's off, simply ignore the object_cache alloc failure will just loses > track of some memory objects, but could increase the usability of kmemleak > under memory stress. > > The default action for oom is still disable kmemleak, > echo oom=ignore > /sys/kernel/debug/kmemleak can change to action to > ignore oom. > > Signed-off-by: Shu Wang > --- > Documentation/dev-tools/kmemleak.rst | 5 + > mm/kmemleak.c| 10 +- > 2 files changed, 14 insertions(+), 1 deletion(-) > > diff --git a/Documentation/dev-tools/kmemleak.rst > b/Documentation/dev-tools/kmemleak.rst > index cb88626..3013809 100644 > --- a/Documentation/dev-tools/kmemleak.rst > +++ b/Documentation/dev-tools/kmemleak.rst > @@ -60,6 +60,11 @@ Memory scanning parameters can be modified at run-time by > writing to the > or free all kmemleak objects if kmemleak has been disabled. > - dump= > dump information about the object found at > +- oom=disable > +disable kmemleak after system out of memory (default) > +- oom=ignore > +do not disable kmemleak after system out of memory > +(useful for memory stress test, but will lose some objects) > > Kmemleak can also be disabled at boot-time by passing ``kmemleak=off`` on > the kernel command line. > diff --git a/mm/kmemleak.c b/mm/kmemleak.c > index 7780cd8..a58080f 100644 > --- a/mm/kmemleak.c > +++ b/mm/kmemleak.c > @@ -236,6 +236,9 @@ static DEFINE_MUTEX(scan_mutex); > static int kmemleak_skip_disable; > /* If there are leaks that can be reported */ > static bool kmemleak_found_leaks; > +/* If disable kmemleak after out of memory */ > +static bool kmemleak_oom_disable = true; > + > > /* > * Early object allocation/freeing logging. Kmemleak is initialized after > the > @@ -556,7 +559,8 @@ static struct kmemleak_object *create_object(unsigned > long ptr, size_t size, > object = kmem_cache_alloc(object_cache, gfp_kmemleak_mask(gfp)); > if (!object) { > pr_warn("Cannot allocate a kmemleak_object structure\n"); > - kmemleak_disable(); > + if (kmemleak_oom_disable) > + kmemleak_disable(); > return NULL; > } > > @@ -1888,6 +1892,10 @@ static ssize_t kmemleak_write(struct file *file, const > char __user *user_buf, > kmemleak_scan(); > else if (strncmp(buf, "dump=", 5) == 0) > ret = dump_str_object_info(buf + 5); > + else if (strncmp(buf, "oom=ignore", 10)) > + kmemleak_oom_disable = false; > + else if (strncmp(buf, "oom=disable", 11)) > + kmemleak_oom_disable = true; > else > ret = -EINVAL; > > -- > 2.5.0 > > -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
"make distclean" doesn't get rid of scripts/docproc
just noticed that distclean doesn't remove the generated executable scripts/docproc, whose responsibility is that? rday -- Robert P. J. Day Ottawa, Ontario, CANADA http://crashcourse.ca Twitter: http://twitter.com/rpjday LinkedIn: http://ca.linkedin.com/in/rpjday -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 5/6] sphinx.rst: describe the install requirements for kfigure
As we now have a document describing the install requirements for Sphinx, add there the need for GraphViz and ImageMagick. Signed-off-by: Mauro Carvalho Chehab --- Documentation/doc-guide/sphinx.rst | 13 + 1 file changed, 13 insertions(+) diff --git a/Documentation/doc-guide/sphinx.rst b/Documentation/doc-guide/sphinx.rst index 4c6cb454eaa0..3a41483ed499 100644 --- a/Documentation/doc-guide/sphinx.rst +++ b/Documentation/doc-guide/sphinx.rst @@ -68,6 +68,18 @@ the virtual environment before building the documentation. functionalities required for ``XeLaTex`` to work. For PDF output you'll also need ``convert(1)`` from ImageMagick (https://www.imagemagick.org). +Image output + + +The kernel documentation build system contains an extension that +handles images on both GraphViz and SVG formats (see +:ref:`sphinx_kfigure`). + +For it to work, you need to install both GraphViz and ImageMagick +packages. If those packages are not installed, the build system will +still build the documentation, but won't include any images at the +output. + Sphinx Build @@ -278,6 +290,7 @@ Rendered as: - column 3 +.. _sphinx_kfigure: Figures & Images -- 2.13.0 -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/6] changes.rst: Update Sphinx minimal requirements
The kfigure module doesn't work with Sphinx version 1.2. So, update the minimal requirements accordingly. Signed-off-by: Mauro Carvalho Chehab --- Documentation/process/changes.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/process/changes.rst b/Documentation/process/changes.rst index adbb50ae5246..ceddf1d1e646 100644 --- a/Documentation/process/changes.rst +++ b/Documentation/process/changes.rst @@ -53,7 +53,7 @@ mcelog 0.6 mcelog --version iptables 1.4.2iptables -V openssl & libcrypto1.0.0openssl version bc 1.06.95 bc --version -Sphinx\ [#f1]_1.2 sphinx-build --version +Sphinx\ [#f1]_1.3 sphinx-build --version == === .. [#f1] Sphinx is needed only to build the Kernel documentation @@ -310,8 +310,8 @@ Sphinx -- The ReST markups currently used by the Documentation/ files are meant to be -built with ``Sphinx`` version 1.2 or upper. If you're desiring to build -PDF outputs, it is recommended to use version 1.4.6. +built with ``Sphinx`` version 1.3 or upper. If you're desiring to build +PDF outputs, it is recommended to use version 1.4.6 or upper. .. note:: -- 2.13.0 -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 0/6] Better document Sphinx install instructions
The Sphinx build chain is fragile: any upgrades can cause it to break. That's what happened this week, when I upgraded my machines to Fedora 26. So, add a separate chapter at sphinx.rst with Sphinx install instructions, moving it out of changes.rst. Mauro Carvalho Chehab (6): changes.rst: Update Sphinx minimal requirements docs-rst: update Sphinx install instructions sphinx.rst: explain the usage of virtual environment sphinx.rst: fix unknown reference sphinx.rst: describe the install requirements for kfigure sphinx.rst: better organize the documentation about PDF build Documentation/doc-guide/sphinx.rst | 69 +- Documentation/process/changes.rst | 16 ++--- 2 files changed, 71 insertions(+), 14 deletions(-) -- 2.13.0 -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 6/6] sphinx.rst: better organize the documentation about PDF build
Instead of having it on just one note, add a separate section. This way, we could later improve it, providing a better guide about the needed steps for PDF builds. Signed-off-by: Mauro Carvalho Chehab --- Documentation/doc-guide/sphinx.rst | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Documentation/doc-guide/sphinx.rst b/Documentation/doc-guide/sphinx.rst index 3a41483ed499..5521213efa68 100644 --- a/Documentation/doc-guide/sphinx.rst +++ b/Documentation/doc-guide/sphinx.rst @@ -60,14 +60,6 @@ in order to indicate that you're using the new environment. If you open a new shell, you need to rerun this command to enter again at the virtual environment before building the documentation. -.. note:: - - Please notice that, for PDF and LaTeX output, you'll also need ``XeLaTeX`` - version 3.14159265. Depending on the distribution, you may also need to - install a series of ``texlive`` packages that provide the minimal set of - functionalities required for ``XeLaTex`` to work. For PDF output you'll also - need ``convert(1)`` from ImageMagick (https://www.imagemagick.org). - Image output @@ -80,6 +72,19 @@ packages. If those packages are not installed, the build system will still build the documentation, but won't include any images at the output. +PDF and LaTeX builds + + +Such builds are currently supported only with Sphinx versions 1.4 and 1.5. + +Currently, it is not possible to do pdf builds with Sphinx version 1.6. + +For PDF and LaTeX output, you'll also need ``XeLaTeX`` version 3.14159265. + +Depending on the distribution, you may also need to install a series of +``texlive`` packages that provide the minimal set of functionalities +required for ``XeLaTex`` to work. + Sphinx Build -- 2.13.0 -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/6] docs-rst: update Sphinx install instructions
The toolchain used by Sphinx is somewhat complex, and installing it should be part of the doc-guide. Move it out of changes.rst. Signed-off-by: Mauro Carvalho Chehab --- Documentation/doc-guide/sphinx.rst | 17 + Documentation/process/changes.rst | 14 ++ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/Documentation/doc-guide/sphinx.rst b/Documentation/doc-guide/sphinx.rst index 84e8e8a9cbdb..1ee109b19322 100644 --- a/Documentation/doc-guide/sphinx.rst +++ b/Documentation/doc-guide/sphinx.rst @@ -19,6 +19,23 @@ Finally, there are thousands of plain text documentation files scattered around ``Documentation``. Some of these will likely be converted to reStructuredText over time, but the bulk of them will remain in plain text. +.. _sphinx_install: + +Sphinx Install +== + +The ReST markups currently used by the Documentation/ files are meant to be +built with ``Sphinx`` version 1.3 or upper. If you're desiring to build +PDF outputs, it is recommended to use version 1.4.6 or upper. + +.. note:: + + Please notice that, for PDF and LaTeX output, you'll also need ``XeLaTeX`` + version 3.14159265. Depending on the distribution, you may also need to + install a series of ``texlive`` packages that provide the minimal set of + functionalities required for ``XeLaTex`` to work. For PDF output you'll also + need ``convert(1)`` from ImageMagick (https://www.imagemagick.org). + Sphinx Build diff --git a/Documentation/process/changes.rst b/Documentation/process/changes.rst index ceddf1d1e646..bb2f2fe886f9 100644 --- a/Documentation/process/changes.rst +++ b/Documentation/process/changes.rst @@ -309,18 +309,8 @@ Kernel documentation Sphinx -- -The ReST markups currently used by the Documentation/ files are meant to be -built with ``Sphinx`` version 1.3 or upper. If you're desiring to build -PDF outputs, it is recommended to use version 1.4.6 or upper. - -.. note:: - - Please notice that, for PDF and LaTeX output, you'll also need ``XeLaTeX`` - version 3.14159265. Depending on the distribution, you may also need to - install a series of ``texlive`` packages that provide the minimal set of - functionalities required for ``XeLaTex`` to work. For PDF output you'll also - need ``convert(1)`` from ImageMagick (https://www.imagemagick.org). - +Please see :ref:`sphinx_install` at the doc-guide for details about +Sphinx requirements. Getting updated software -- 2.13.0 -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/6] sphinx.rst: explain the usage of virtual environment
As the Sphinx build seems very fragile, specially for PDF output, add a notice about how to use it on a virtual environment. Signed-off-by: Mauro Carvalho Chehab --- Documentation/doc-guide/sphinx.rst | 32 1 file changed, 32 insertions(+) diff --git a/Documentation/doc-guide/sphinx.rst b/Documentation/doc-guide/sphinx.rst index 1ee109b19322..3278262164da 100644 --- a/Documentation/doc-guide/sphinx.rst +++ b/Documentation/doc-guide/sphinx.rst @@ -28,6 +28,38 @@ The ReST markups currently used by the Documentation/ files are meant to be built with ``Sphinx`` version 1.3 or upper. If you're desiring to build PDF outputs, it is recommended to use version 1.4.6 or upper. +Most distributions are shipped with Sphinx, but its toolchain is fragile, +and it is not uncommon that upgrading it or some other Python packages +on your machine would cause the documentation build to break. + +A way to get rid of that is to use a different version than the one shipped +on your distributions. In order to do that, it is recommended to install +Sphinx inside a virtual environment, using ``virtualenv-3`` +or ``virtualenv``, depending on how your distribution packaged Python 3. + +.. note:: + + #) Sphinx versions below 1.5 don't work properly with Python's + docutils version 0.13.1 or upper. So, if you're willing to use + those versions, you should run ``pip install 'docutils==0.12'``. + + #) It is recommended to use the RTD theme for html output. Depending + on the Sphinx version, it should be installed in separate, + with ``pip install sphinx_rtd_theme``. + +In summary, if you want to install Sphinx version 1.4.9, you should do:: + + $ virtualenv sphinx_1.4 + $ . sphinx_1.4/bin/activate + (sphinx_1.4) $ pip install 'docutils==0.12' + (sphinx_1.4) $ pip install 'Sphinx==1.4.9' + (sphinx_1.4) $ pip install sphinx_rtd_theme + +After running ``. sphinx_1.4/bin/activate``, the prompt will change, +in order to indicate that you're using the new environment. If you +open a new shell, you need to rerun this command to enter again at +the virtual environment before building the documentation. + .. note:: Please notice that, for PDF and LaTeX output, you'll also need ``XeLaTeX`` -- 2.13.0 -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 4/6] sphinx.rst: fix unknown reference
There's no "Sphinx C Domain" reference at the Kernel documentation. So, don't use references for it. Signed-off-by: Mauro Carvalho Chehab --- Documentation/doc-guide/sphinx.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/doc-guide/sphinx.rst b/Documentation/doc-guide/sphinx.rst index 3278262164da..4c6cb454eaa0 100644 --- a/Documentation/doc-guide/sphinx.rst +++ b/Documentation/doc-guide/sphinx.rst @@ -167,7 +167,7 @@ Here are some specific guidelines for the kernel documentation: the C domain -The `Sphinx C Domain`_ (name c) is suited for documentation of C API. E.g. a +The **Sphinx C Domain** (name c) is suited for documentation of C API. E.g. a function prototype: .. code-block:: rst -- 2.13.0 -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/6] docs-rst: update Sphinx install instructions
On Fri, 14 Jul 2017 08:08:19 -0300 Mauro Carvalho Chehab wrote: > +Please see :ref:`sphinx_install` at the doc-guide for details about > +Sphinx requirements. One small comment here: formatting things this way assumes that people are reading the documentation in a web browser. Can we replace "at the doc-guide" with "in Documentation/doc-guide/sphinx.rst" to improve the usability of the plain-text files? Otherwise the series looks good to me, thanks. jon -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/6] docs-rst: update Sphinx install instructions
> Am 14.07.2017 um 17:44 schrieb Jonathan Corbet : > > On Fri, 14 Jul 2017 08:08:19 -0300 > Mauro Carvalho Chehab wrote: > >> +Please see :ref:`sphinx_install` at the doc-guide for details about >> +Sphinx requirements. > > One small comment here: formatting things this way assumes that people are > reading the documentation in a web browser. Can we replace "at the > doc-guide" with "in Documentation/doc-guide/sphinx.rst" to improve the > usability of the plain-text files? Hm .. I suppose there is a plain text builder for sphinx .. but building plain-text before reading sources seems not an acceptable option ;) -- Markus -- -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 3/6] sphinx.rst: explain the usage of virtual environment
As the Sphinx build seems very fragile, specially for PDF output, add a notice about how to use it on a virtual environment. Signed-off-by: Mauro Carvalho Chehab --- Documentation/doc-guide/sphinx.rst | 32 1 file changed, 32 insertions(+) diff --git a/Documentation/doc-guide/sphinx.rst b/Documentation/doc-guide/sphinx.rst index 1ee109b19322..3278262164da 100644 --- a/Documentation/doc-guide/sphinx.rst +++ b/Documentation/doc-guide/sphinx.rst @@ -28,6 +28,38 @@ The ReST markups currently used by the Documentation/ files are meant to be built with ``Sphinx`` version 1.3 or upper. If you're desiring to build PDF outputs, it is recommended to use version 1.4.6 or upper. +Most distributions are shipped with Sphinx, but its toolchain is fragile, +and it is not uncommon that upgrading it or some other Python packages +on your machine would cause the documentation build to break. + +A way to get rid of that is to use a different version than the one shipped +on your distributions. In order to do that, it is recommended to install +Sphinx inside a virtual environment, using ``virtualenv-3`` +or ``virtualenv``, depending on how your distribution packaged Python 3. + +.. note:: + + #) Sphinx versions below 1.5 don't work properly with Python's + docutils version 0.13.1 or upper. So, if you're willing to use + those versions, you should run ``pip install 'docutils==0.12'``. + + #) It is recommended to use the RTD theme for html output. Depending + on the Sphinx version, it should be installed in separate, + with ``pip install sphinx_rtd_theme``. + +In summary, if you want to install Sphinx version 1.4.9, you should do:: + + $ virtualenv sphinx_1.4 + $ . sphinx_1.4/bin/activate + (sphinx_1.4) $ pip install 'docutils==0.12' + (sphinx_1.4) $ pip install 'Sphinx==1.4.9' + (sphinx_1.4) $ pip install sphinx_rtd_theme + +After running ``. sphinx_1.4/bin/activate``, the prompt will change, +in order to indicate that you're using the new environment. If you +open a new shell, you need to rerun this command to enter again at +the virtual environment before building the documentation. + .. note:: Please notice that, for PDF and LaTeX output, you'll also need ``XeLaTeX`` -- 2.13.0 -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 2/6] docs-rst: move Sphinx install instructions to sphinx.rst
The toolchain used by Sphinx is somewhat complex, and installing it should be part of the doc-guide. Move it out of changes.rst. Signed-off-by: Mauro Carvalho Chehab --- Documentation/doc-guide/sphinx.rst | 17 + Documentation/process/changes.rst | 14 ++ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/Documentation/doc-guide/sphinx.rst b/Documentation/doc-guide/sphinx.rst index 84e8e8a9cbdb..1ee109b19322 100644 --- a/Documentation/doc-guide/sphinx.rst +++ b/Documentation/doc-guide/sphinx.rst @@ -19,6 +19,23 @@ Finally, there are thousands of plain text documentation files scattered around ``Documentation``. Some of these will likely be converted to reStructuredText over time, but the bulk of them will remain in plain text. +.. _sphinx_install: + +Sphinx Install +== + +The ReST markups currently used by the Documentation/ files are meant to be +built with ``Sphinx`` version 1.3 or upper. If you're desiring to build +PDF outputs, it is recommended to use version 1.4.6 or upper. + +.. note:: + + Please notice that, for PDF and LaTeX output, you'll also need ``XeLaTeX`` + version 3.14159265. Depending on the distribution, you may also need to + install a series of ``texlive`` packages that provide the minimal set of + functionalities required for ``XeLaTex`` to work. For PDF output you'll also + need ``convert(1)`` from ImageMagick (https://www.imagemagick.org). + Sphinx Build diff --git a/Documentation/process/changes.rst b/Documentation/process/changes.rst index ceddf1d1e646..560beaef5a7c 100644 --- a/Documentation/process/changes.rst +++ b/Documentation/process/changes.rst @@ -309,18 +309,8 @@ Kernel documentation Sphinx -- -The ReST markups currently used by the Documentation/ files are meant to be -built with ``Sphinx`` version 1.3 or upper. If you're desiring to build -PDF outputs, it is recommended to use version 1.4.6 or upper. - -.. note:: - - Please notice that, for PDF and LaTeX output, you'll also need ``XeLaTeX`` - version 3.14159265. Depending on the distribution, you may also need to - install a series of ``texlive`` packages that provide the minimal set of - functionalities required for ``XeLaTex`` to work. For PDF output you'll also - need ``convert(1)`` from ImageMagick (https://www.imagemagick.org). - +Please see :ref:`sphinx_install` in ``Documentation/doc-guide/sphinx.rst`` +for details about Sphinx requirements. Getting updated software -- 2.13.0 -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 4/6] sphinx.rst: fix unknown reference
There's no "Sphinx C Domain" reference at the Kernel documentation. So, don't use references for it. Signed-off-by: Mauro Carvalho Chehab --- Documentation/doc-guide/sphinx.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/doc-guide/sphinx.rst b/Documentation/doc-guide/sphinx.rst index 3278262164da..4c6cb454eaa0 100644 --- a/Documentation/doc-guide/sphinx.rst +++ b/Documentation/doc-guide/sphinx.rst @@ -167,7 +167,7 @@ Here are some specific guidelines for the kernel documentation: the C domain -The `Sphinx C Domain`_ (name c) is suited for documentation of C API. E.g. a +The **Sphinx C Domain** (name c) is suited for documentation of C API. E.g. a function prototype: .. code-block:: rst -- 2.13.0 -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 0/6] Better document Sphinx install instructions
The Sphinx build chain is fragile: any upgrades can cause it to break. That's what happened this week, when I upgraded my machines to Fedora 26. So, add a separate chapter at sphinx.rst with Sphinx install instructions, moving it out of changes.rst. and better name patch 2/6. v2: improved the text at changes.rst to point to the file name with the Sphinx build instructions. Mauro Carvalho Chehab (6): changes.rst: Update Sphinx minimal requirements docs-rst: move Sphinx install instructions to sphinx.rst sphinx.rst: explain the usage of virtual environment sphinx.rst: fix unknown reference sphinx.rst: describe the install requirements for kfigure sphinx.rst: better organize the documentation about PDF build Documentation/doc-guide/sphinx.rst | 69 +- Documentation/process/changes.rst | 16 ++--- 2 files changed, 71 insertions(+), 14 deletions(-) -- 2.13.0 -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 5/6] sphinx.rst: describe the install requirements for kfigure
As we now have a document describing the install requirements for Sphinx, add there the need for GraphViz and ImageMagick. Signed-off-by: Mauro Carvalho Chehab --- Documentation/doc-guide/sphinx.rst | 13 + 1 file changed, 13 insertions(+) diff --git a/Documentation/doc-guide/sphinx.rst b/Documentation/doc-guide/sphinx.rst index 4c6cb454eaa0..3a41483ed499 100644 --- a/Documentation/doc-guide/sphinx.rst +++ b/Documentation/doc-guide/sphinx.rst @@ -68,6 +68,18 @@ the virtual environment before building the documentation. functionalities required for ``XeLaTex`` to work. For PDF output you'll also need ``convert(1)`` from ImageMagick (https://www.imagemagick.org). +Image output + + +The kernel documentation build system contains an extension that +handles images on both GraphViz and SVG formats (see +:ref:`sphinx_kfigure`). + +For it to work, you need to install both GraphViz and ImageMagick +packages. If those packages are not installed, the build system will +still build the documentation, but won't include any images at the +output. + Sphinx Build @@ -278,6 +290,7 @@ Rendered as: - column 3 +.. _sphinx_kfigure: Figures & Images -- 2.13.0 -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 1/6] changes.rst: Update Sphinx minimal requirements
The kfigure module doesn't work with Sphinx version 1.2. So, update the minimal requirements accordingly. Signed-off-by: Mauro Carvalho Chehab --- Documentation/process/changes.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/process/changes.rst b/Documentation/process/changes.rst index adbb50ae5246..ceddf1d1e646 100644 --- a/Documentation/process/changes.rst +++ b/Documentation/process/changes.rst @@ -53,7 +53,7 @@ mcelog 0.6 mcelog --version iptables 1.4.2iptables -V openssl & libcrypto1.0.0openssl version bc 1.06.95 bc --version -Sphinx\ [#f1]_1.2 sphinx-build --version +Sphinx\ [#f1]_1.3 sphinx-build --version == === .. [#f1] Sphinx is needed only to build the Kernel documentation @@ -310,8 +310,8 @@ Sphinx -- The ReST markups currently used by the Documentation/ files are meant to be -built with ``Sphinx`` version 1.2 or upper. If you're desiring to build -PDF outputs, it is recommended to use version 1.4.6. +built with ``Sphinx`` version 1.3 or upper. If you're desiring to build +PDF outputs, it is recommended to use version 1.4.6 or upper. .. note:: -- 2.13.0 -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 6/6] sphinx.rst: better organize the documentation about PDF build
Instead of having it on just one note, add a separate section. This way, we could later improve it, providing a better guide about the needed steps for PDF builds. Signed-off-by: Mauro Carvalho Chehab --- Documentation/doc-guide/sphinx.rst | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Documentation/doc-guide/sphinx.rst b/Documentation/doc-guide/sphinx.rst index 3a41483ed499..5521213efa68 100644 --- a/Documentation/doc-guide/sphinx.rst +++ b/Documentation/doc-guide/sphinx.rst @@ -60,14 +60,6 @@ in order to indicate that you're using the new environment. If you open a new shell, you need to rerun this command to enter again at the virtual environment before building the documentation. -.. note:: - - Please notice that, for PDF and LaTeX output, you'll also need ``XeLaTeX`` - version 3.14159265. Depending on the distribution, you may also need to - install a series of ``texlive`` packages that provide the minimal set of - functionalities required for ``XeLaTex`` to work. For PDF output you'll also - need ``convert(1)`` from ImageMagick (https://www.imagemagick.org). - Image output @@ -80,6 +72,19 @@ packages. If those packages are not installed, the build system will still build the documentation, but won't include any images at the output. +PDF and LaTeX builds + + +Such builds are currently supported only with Sphinx versions 1.4 and 1.5. + +Currently, it is not possible to do pdf builds with Sphinx version 1.6. + +For PDF and LaTeX output, you'll also need ``XeLaTeX`` version 3.14159265. + +Depending on the distribution, you may also need to install a series of +``texlive`` packages that provide the minimal set of functionalities +required for ``XeLaTex`` to work. + Sphinx Build -- 2.13.0 -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RFC] scripts/sphinx-pre-install: add a script to check Sphinx install
Solving Sphinx dependencies can be painful. Add a script to check if everything is ok. Signed-off-by: Mauro Carvalho Chehab --- For now, this is just a RFC for a script that would detect (and eventually install) the dependencies for Sphinx builds. I tested it only with Ubuntu 17.04, as I created a lxc container with it, from scratch, and tested Sphinx builds there for both htmldocs and pdfdocs. That's said, I noticed that, currently, on Ubuntu with Sphinx 1.5, this is needed, in order to build a SVG file used on media.pdf: +Please notice that, due to the way LaTeX handles SVG images, you may need +to increase the memory it uses for handing images, using the following +settings for texmf.cnf[#f1]_:: + + main_memory = 1200 + extra_mem_bot = 1200 + font_mem_size = 1200 + pool_size = 1200 + buf_size = 1200 + +.. note:: + On Debian/Ubuntu, the texmf.cnf is auto-generated. So, the above + settings should be added at ``/etc/texmf/texmf.d/00debian.cnf`` + file, and updated with ``update-texmf``. + +.. [f1] https://gordonlesti.com/debian-increase-latex-main-memory-size/ + I guess I'll try, instead, to simplify the SVG there, instead of documenting the need of another hack for Sphinx build instructions. Yet, it sucks that PDF build is so fragile! scripts/sphinx-pre-install | 249 + 1 file changed, 249 insertions(+) create mode 100755 scripts/sphinx-pre-install diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install new file mode 100755 index ..305731e0ab9c --- /dev/null +++ b/scripts/sphinx-pre-install @@ -0,0 +1,249 @@ +#!/usr/bin/perl +use strict; + +# +# Static vars +# + +my @missing; +my @opt_missing; +my $system_release; + +## +# Subroutines used at the check missing deps logic +## + +sub catcheck($) +{ + my $res = ""; + $res = qx(cat $_[0]) if (-r $_[0]); + return $res; +} + +my $install; +sub check_missing(%) +{ + my %map = %{$_[0]}; + + foreach my $prog (@missing) { + print "ERROR: please install \"$prog\", otherwise, build won't work.\n"; + if (defined($map{$prog})) { + $install .= " " . $map{$prog}; + } else { + $install .= " " . $prog; + } + } + foreach my $prog (@opt_missing) { + print "Warning: better to also install \"$prog\".\n"; + if (defined($map{$prog})) { + $install .= " " . $map{$prog}; + } else { + $install .= " " . $prog; + } + } + + $install =~ s/^\s//; +} + +sub give_ubuntu_hints() +{ + my %map = ( + "sphinx-build" => "python3-sphinx python3-sphinx-rtd-theme", + "dot" => "graphviz", + "convert" => "imagemagick", + "Pod::Usage"=> "perl-modules", + "xelatex" => "texlive-xetex", + ); + + check_missing(\%map); + printf("You should run:\n\n\tsudo apt-get install $install\n\n"); +} + +sub give_redhat_hints() +{ + my %map = ( + "sphinx-build" => "python3-sphinx python3-sphinx_rtd_theme", + "dot" => "graphviz", + "convert" => "ImageMagick", + "Pod::Usage"=> "perl-Pod-Usage", + "xelatex" => "texlive-xetex-bin", + ); + + check_missing(\%map); + printf("You should run:\n\n\tyum install -y $install\n\n"); +} + +sub give_opensuse_hints() +{ + my %map = ( + # FIXME: add hints for SUSE here + ); + + check_missing(\%map); + printf("You should run:\n\n\tsudo zypper install $install\n\n"); +} + +sub give_arch_linux_hints() +{ + my %map = ( + # FIXME: add hints for arch-linux here + ); + + check_missing(\%map); + printf("You should install those package(s) (repository/package): $install\n\n"); +} + +sub give_gentoo_hints() +{ + my %map = ( + # FIXME: add hints for Gentoo here + ); + + check_missing(\%map); + printf("You should emerge those package(s): $install\n\n"); +} + +sub give_hints() +{ + # Distro-specific hints + if ($system_release =~ /Red Hat Enterprise Linux/) { + give_redhat_hints; + return; + } + if ($system_release =~ /Fedora/) { + give_redhat_hints; + return; + } + if ($system_release =~ /Ubuntu/) { + give_ubuntu_hints; + return; + } + if ($system_release =~ /openSUSE/) { + give_opensuse_hints; + return; + } +
Re: [PATCH RFC] scripts/sphinx-pre-install: add a script to check Sphinx install
> Am 14.07.2017 um 18:49 schrieb Mauro Carvalho Chehab > : > > Solving Sphinx dependencies can be painful. Add a script to > check if everything is ok. just my 5cent: What we need is a "requirements.txt" file to define a **reference environment**. E.g. to stick Sphinx 1.4.9 in such a reference environment:: --- Sphinx==1.4.9 sphinx_rtd_theme - The rest is similarly to what you wrote in doc-guide/sphinx.rst ... The ref-environment can be build with virtualenv & pip:: $ virtualenv --python=python3 docenv (doc-env) $ source ./docenv/bin/activate (doc-env) $ pip install -r requirements.txt >From now we can start our build as usual. If not already done, first activate the environment:: $ . ./docenv/bin/activate (doc-env) $ make htmldocs This (requirements.txt) is the way python packaging goes. Ok, this won't solve TeX installation problems of Linux distros, for this a script like the one here in your RFC is helpful. -- Markus -- -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH RFC] scripts/sphinx-pre-install: add a script to check Sphinx install
On Fri, Jul 14, 2017 at 10:35 AM, Markus Heiser wrote: > > > Ok, this won't solve TeX installation problems of Linux distros, Which seems to be the thorniest problem. It's one thing to identify which sphinx versions work, and another to figure out which of the metric boatload of TeX packages are needed. On a fresh Fedora 26 install I was able to get "make pdfdocs" to build (hurrah!) after adding ImageMagick latex sphinx-build texlive-adjustbox texlive-babel-english texlive-capt-of texlive-cm texlive-cmap texlive-ec texlive-eqparbox texlive-euenc texlive-fancyhdr texlive-fncychap texlive-framed texlive-hyphen-base texlive-mdwtools texlive-multirow texlive-parskip texlive-tablefootnote texlive-tabulary texlive-threeparttable texlive-titlesec texlive-unicode-data texlive-upquote texlive-wrapfig xelatex which ended up installing about 160 RPMs. Figuring out the right texlive parts wasn't much fun; footnote.sty is well-hidden in texlive-mdwtools, for instance, and without texlive-babel-english the build failed with very mysterious errors in userspace-api. Jim -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 00/53] Get rid of Docbook
On Thu, Jul 6, 2017 at 1:54 AM, Markus Heiser wrote: > 52b3f23 Docs: clean up some DocBook loose ends Speaking of minor loose ends, make SPHINXDIRS=userspace-api pdfdocs works -- though now that it's all sphinx, wouldn't just DIRS be better? -- and make DOCBOOKS=userspace-api pdfdocs still works too. But that generates all of the pdf files, and not just the userspace-api.pdf. And running now-dead targets like "make ps" or "make sgmldocs" or "make mandocs" just returns with no output. -- Jim -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2] kmemleak: add oom= runtime parameter
From: Shu Wang When running memory stress tests, kmemleak could be easily disabled in function create_object as system is out of memory and kmemleak failed to alloc from object_cache. Since there's no way to enable kmemleak after it's off, simply ignore the object_cache alloc failure will just loses track of some memory objects, but could increase the usability of kmemleak under memory stress. The default action for oom is still disable kmemleak, echo oom=ignore > /sys/kernel/debug/kmemleak can change to action to ignore oom. Signed-off-by: Shu Wang --- Documentation/dev-tools/kmemleak.rst | 5 + mm/kmemleak.c| 10 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Documentation/dev-tools/kmemleak.rst b/Documentation/dev-tools/kmemleak.rst index cb88626..3013809 100644 --- a/Documentation/dev-tools/kmemleak.rst +++ b/Documentation/dev-tools/kmemleak.rst @@ -60,6 +60,11 @@ Memory scanning parameters can be modified at run-time by writing to the or free all kmemleak objects if kmemleak has been disabled. - dump= dump information about the object found at +- oom=disable +disable kmemleak after system out of memory (default) +- oom=ignore +do not disable kmemleak after system out of memory +(useful for memory stress test, but will lose some objects) Kmemleak can also be disabled at boot-time by passing ``kmemleak=off`` on the kernel command line. diff --git a/mm/kmemleak.c b/mm/kmemleak.c index 7780cd8..b5cb2c6 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -236,6 +236,9 @@ static DEFINE_MUTEX(scan_mutex); static int kmemleak_skip_disable; /* If there are leaks that can be reported */ static bool kmemleak_found_leaks; +/* If disable kmemleak after out of memory */ +static bool kmemleak_oom_disable = true; + /* * Early object allocation/freeing logging. Kmemleak is initialized after the @@ -556,7 +559,8 @@ static struct kmemleak_object *create_object(unsigned long ptr, size_t size, object = kmem_cache_alloc(object_cache, gfp_kmemleak_mask(gfp)); if (!object) { pr_warn("Cannot allocate a kmemleak_object structure\n"); - kmemleak_disable(); + if (kmemleak_oom_disable) + kmemleak_disable(); return NULL; } @@ -1888,6 +1892,10 @@ static ssize_t kmemleak_write(struct file *file, const char __user *user_buf, kmemleak_scan(); else if (strncmp(buf, "dump=", 5) == 0) ret = dump_str_object_info(buf + 5); + else if (strncmp(buf, "oom=ignore", 10) == 0) + kmemleak_oom_disable = false; + else if (strncmp(buf, "oom=disable", 11) == 0) + kmemleak_oom_disable = true; else ret = -EINVAL; -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC v2] scripts/sphinx-pre-install: add a script to check Sphinx install
Solving Sphinx dependencies can be painful. Add a script to check if everything is ok. Tested on Fedora 26 and Ubuntu 17.04. Signed-off-by: Mauro Carvalho Chehab --- v2: add support for Fedora 26 scripts/sphinx-pre-install | 321 + 1 file changed, 321 insertions(+) create mode 100755 scripts/sphinx-pre-install diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install new file mode 100755 index ..140e01b9bb86 --- /dev/null +++ b/scripts/sphinx-pre-install @@ -0,0 +1,321 @@ +#!/usr/bin/perl +use strict; + +# +# Static vars +# + +my @missing; +my @opt_missing; +my $system_release; +my $need = 0; +my $optional = 0; +my $need_symlink = 0; +my $install = ""; + +## +# Subroutines used at the check missing deps logic +## + +sub catcheck($) +{ + my $res = ""; + $res = qx(cat $_[0]) if (-r $_[0]); + return $res; +} + +sub check_missing(%) +{ + my %map = %{$_[0]}; + + foreach my $prog (@missing) { + print "ERROR: please install \"$prog\", otherwise, build won't work.\n"; + if (defined($map{$prog})) { + $install .= " " . $map{$prog}; + } else { + $install .= " " . $prog; + } + } + foreach my $prog (@opt_missing) { + print "Warning: better to also install \"$prog\".\n"; + if (defined($map{$prog})) { + $install .= " " . $map{$prog}; + } else { + $install .= " " . $prog; + } + } + + $install =~ s/^\s//; +} + +sub add_package($$) +{ + my $package = shift; + my $is_optional = shift; + + if ($is_optional) { + push @opt_missing, $package; + + $optional++; + } else { + push @missing, $package; + + $need++; + } +} + +sub check_missing_file($$$) +{ + my $file = shift; + my $package = shift; + my $is_optional = shift; + + return if(-e $file); + + add_package($package, $is_optional); +} + +sub findprog($) +{ + foreach(split(/:/, $ENV{PATH})) { + return "$_/$_[0]" if(-x "$_/$_[0]"); + } +} + +sub check_program($$) +{ + my $prog = shift; + my $is_optional = shift; + + return if findprog($prog); + + add_package($prog, $is_optional); +} + +sub check_perl_module($$) +{ + my $prog = shift; + my $is_optional = shift; + + my $err = system("perl -M$prog -e 1 2>/dev/null /dev/null"); + return if ($err == 0); + + add_package($prog, $is_optional); +} + +sub check_python_module($$) +{ + my $prog = shift; + my $is_optional = shift; + + my $err = system("python3 -c 'import $prog' 2>/dev/null /dev/null"); + return if ($err == 0); + my $err = system("python -c 'import $prog' 2>/dev/null /dev/null"); + return if ($err == 0); + + add_package($prog, $is_optional); +} + +sub check_sphinx() +{ + return if findprog("sphinx-build"); + + if (findprog("sphinx-build-3")) { + $need_symlink = 1; + return; + } + + add_package("python-sphinx", 0); +} + +sub which($) +{ + my $file = shift; + my @path = split ":", $ENV{PATH}; + + foreach my $dir(@path) { + my $name = $dir.'/'.$file; + return $name if (-x $name ); + } + return undef; +} + +sub give_debian_hints() +{ + my %map = ( + "python-sphinx" => "python3-sphinx", + "sphinx_rtd_theme" => "python3-sphinx-rtd-theme", + "dot" => "graphviz", + "convert" => "imagemagick", + "Pod::Usage"=> "perl-modules", + "xelatex" => "texlive-xetex", + ); + + check_missing(\%map); + + return if (!$need && !$optional); + printf("You should run:\n\n\tsudo apt-get install $install\n"); +} + +sub give_redhat_hints() +{ + my %map = ( + "python-sphinx" => "python3-sphinx", + "sphinx_rtd_theme" => "python3-sphinx_rtd_theme", + "dot" => "graphviz", + "convert" => "ImageMagick", + "Pod::Usage"=> "perl-Pod-Usage", + "xelatex" => "texlive-xetex-bin python-sphinx-latex.noarch", + ); + + check_missing_file("/usr/share/licenses/python-sphinx-latex/LICENSE", + "python-sphinx-latex", 1); + check_missing_file("/usr/share/fonts/dejavu/DejaVuSans.ttf", + "dejavu-sans-fonts", 1); + check_missing_file("/usr/share/fonts/dejavu/DejaVuSerif.ttf", +
Re: [PATCH RFC] scripts/sphinx-pre-install: add a script to check Sphinx install
Em Fri, 14 Jul 2017 15:51:03 -0700 Jim Davis escreveu: > On Fri, Jul 14, 2017 at 10:35 AM, Markus Heiser > wrote: > > > > > > Ok, this won't solve TeX installation problems of Linux distros, > > Which seems to be the thorniest problem. It's one thing to identify > which sphinx versions work, and another to figure out which of the > metric boatload of TeX packages are needed. Yes. That's likely the hardest part. > On a fresh Fedora 26 install I was able to get "make pdfdocs" to build > (hurrah!) after adding Just sent a version 2 of the script, with support for Fedora 26. I tested with a Fedora lxc container. The only package I had to manually install there is perl. I'm pretty sure that a minimal Fedora image (outside a LXC) already comes with perl, so I guess the script is an improvement over manually checking all needed dependencies. > ImageMagick > latex > sphinx-build > texlive-adjustbox > texlive-babel-english > texlive-capt-of > texlive-cm > texlive-cmap > texlive-ec > texlive-eqparbox > texlive-euenc > texlive-fancyhdr > texlive-fncychap > texlive-framed > texlive-hyphen-base > texlive-mdwtools > texlive-multirow > texlive-parskip > texlive-tablefootnote > texlive-tabulary > texlive-threeparttable > texlive-titlesec > texlive-unicode-data > texlive-upquote > texlive-wrapfig > xelatex There is a package called "python-sphinx-latex" that seems to install almost everything needed for Fedora 26. This one, plus: xelatex texlive-adjustbox It also optionally require DeJavu fonts. are enough for PDF build. You still need: ImageMagick graphviz for both html and pdf targets, if you want to have support for images. > which ended up installing about 160 RPMs. Figuring out the right > texlive parts wasn't much fun; footnote.sty is well-hidden in > texlive-mdwtools, for instance, and without texlive-babel-english the > build failed with very mysterious errors in userspace-api. Yeah, that's why I think the right solution is to have a script that will identify the distribution and install the missing dependencies. Thanks, Mauro -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 00/53] Get rid of Docbook
Em Fri, 14 Jul 2017 16:15:23 -0700 Jim Davis escreveu: > On Thu, Jul 6, 2017 at 1:54 AM, Markus Heiser > wrote: > > > 52b3f23 Docs: clean up some DocBook loose ends > > Speaking of minor loose ends, > > make SPHINXDIRS=userspace-api pdfdocs > > works -- though now that it's all sphinx, wouldn't just DIRS be better? -- and Hmm... I don't like the idea of just DIRS, as there are other paths used on Makefile (INSTALL_PATH, INSTALL_MOD_PATH, INSTALL_HDR_PATH). > > make DOCBOOKS=userspace-api pdfdocs > > still works too. But that generates all of the pdf files, and not > just the userspace-api.pdf. It will just ignore it. The same happens if you do: make FOO=bar htmldocs Yet, it could make sense to either warn or make it equivalent to SPHINXDIRS at the Documentation/Makefile. > And running now-dead targets like "make > ps" or "make sgmldocs" or "make mandocs" just returns with no output. Yeah. We need to get rid of those targets from Documentation/Makefile: sgmldocs: psdocs: mandocs: installmandocs: I guess the enclosed patch should do the trick. Thanks, Mauro - docs: Makefile: remove no-ops targets After removal of DocBook, those targets are bogus. Reported-by: Jim Davis Signed-off-by: Mauro Carvalho Chehab diff --git a/Documentation/Makefile b/Documentation/Makefile index a42320385df3..d75c00e3aadb 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -95,16 +95,6 @@ endif # HAVE_SPHINX # The following targets are independent of HAVE_SPHINX, and the rules should # work or silently pass without Sphinx. -# no-ops for the Sphinx toolchain -sgmldocs: - @: -psdocs: - @: -mandocs: - @: -installmandocs: - @: - cleandocs: $(Q)rm -rf $(BUILDDIR) $(Q)$(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/media clean diff --git a/Documentation/translations/zh_CN/HOWTO b/Documentation/translations/zh_CN/HOWTO index 11be075ba5fa..5f6d09edc9ac 100644 --- a/Documentation/translations/zh_CN/HOWTO +++ b/Documentation/translations/zh_CN/HOWTO @@ -149,9 +149,7 @@ Linux内核代码中包含有大量的文档。这些文档对于学习如何与 核源码的主目录中使用以下不同命令将会分别生成PDF、Postscript、HTML和手册 页等不同格式的文档: make pdfdocs -make psdocs make htmldocs -make mandocs 如何成为内核开发者 diff --git a/Makefile b/Makefile index 547947ff87de..5db9c669e541 100644 --- a/Makefile +++ b/Makefile @@ -1459,7 +1459,7 @@ $(help-board-dirs): help-%: # Documentation targets # --- -DOC_TARGETS := xmldocs sgmldocs psdocs latexdocs pdfdocs htmldocs mandocs installmandocs epubdocs cleandocs linkcheckdocs +DOC_TARGETS := xmldocs latexdocs pdfdocs htmldocs epubdocs cleandocs linkcheckdocs PHONY += $(DOC_TARGETS) $(DOC_TARGETS): scripts_basic FORCE $(Q)$(MAKE) $(build)=Documentation $@ -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC v3] scripts/sphinx-pre-install: add a script to check Sphinx install
Solving Sphinx dependencies can be painful. Add a script to check if everything is ok. Tested on Fedora 26 and Ubuntu 17.04. Signed-off-by: Mauro Carvalho Chehab --- v3: check for DeJavu fonts on Ubuntu and add "sudo" to Fedora instructions v2: add support for Fedora 26 scripts/sphinx-pre-install | 324 + 1 file changed, 324 insertions(+) create mode 100755 scripts/sphinx-pre-install diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install new file mode 100755 index ..fa9976df719e --- /dev/null +++ b/scripts/sphinx-pre-install @@ -0,0 +1,324 @@ +#!/usr/bin/perl +use strict; + +# +# Static vars +# + +my @missing; +my @opt_missing; +my $system_release; +my $need = 0; +my $optional = 0; +my $need_symlink = 0; +my $install = ""; + +## +# Subroutines used at the check missing deps logic +## + +sub catcheck($) +{ + my $res = ""; + $res = qx(cat $_[0]) if (-r $_[0]); + return $res; +} + +sub check_missing(%) +{ + my %map = %{$_[0]}; + + foreach my $prog (@missing) { + print "ERROR: please install \"$prog\", otherwise, build won't work.\n"; + if (defined($map{$prog})) { + $install .= " " . $map{$prog}; + } else { + $install .= " " . $prog; + } + } + foreach my $prog (@opt_missing) { + print "Warning: better to also install \"$prog\".\n"; + if (defined($map{$prog})) { + $install .= " " . $map{$prog}; + } else { + $install .= " " . $prog; + } + } + + $install =~ s/^\s//; +} + +sub add_package($$) +{ + my $package = shift; + my $is_optional = shift; + + if ($is_optional) { + push @opt_missing, $package; + + $optional++; + } else { + push @missing, $package; + + $need++; + } +} + +sub check_missing_file($$$) +{ + my $file = shift; + my $package = shift; + my $is_optional = shift; + + return if(-e $file); + + add_package($package, $is_optional); +} + +sub findprog($) +{ + foreach(split(/:/, $ENV{PATH})) { + return "$_/$_[0]" if(-x "$_/$_[0]"); + } +} + +sub check_program($$) +{ + my $prog = shift; + my $is_optional = shift; + + return if findprog($prog); + + add_package($prog, $is_optional); +} + +sub check_perl_module($$) +{ + my $prog = shift; + my $is_optional = shift; + + my $err = system("perl -M$prog -e 1 2>/dev/null /dev/null"); + return if ($err == 0); + + add_package($prog, $is_optional); +} + +sub check_python_module($$) +{ + my $prog = shift; + my $is_optional = shift; + + my $err = system("python3 -c 'import $prog' 2>/dev/null /dev/null"); + return if ($err == 0); + my $err = system("python -c 'import $prog' 2>/dev/null /dev/null"); + return if ($err == 0); + + add_package($prog, $is_optional); +} + +sub check_sphinx() +{ + return if findprog("sphinx-build"); + + if (findprog("sphinx-build-3")) { + $need_symlink = 1; + return; + } + + add_package("python-sphinx", 0); +} + +sub which($) +{ + my $file = shift; + my @path = split ":", $ENV{PATH}; + + foreach my $dir(@path) { + my $name = $dir.'/'.$file; + return $name if (-x $name ); + } + return undef; +} + +sub give_debian_hints() +{ + my %map = ( + "python-sphinx" => "python3-sphinx", + "sphinx_rtd_theme" => "python3-sphinx-rtd-theme", + "dot" => "graphviz", + "convert" => "imagemagick", + "Pod::Usage"=> "perl-modules", + "xelatex" => "texlive-xetex", + ); + + check_missing_file("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf", + "fonts-dejavu", 1); + + check_missing(\%map); + + return if (!$need && !$optional); + printf("You should run:\n\n\tsudo apt-get install $install\n"); +} + +sub give_redhat_hints() +{ + my %map = ( + "python-sphinx" => "python3-sphinx", + "sphinx_rtd_theme" => "python3-sphinx_rtd_theme", + "dot" => "graphviz", + "convert" => "ImageMagick", + "Pod::Usage"=> "perl-Pod-Usage", + "xelatex" => "texlive-xetex-bin python-sphinx-latex.noarch", + ); + + check_missing_file("/usr/share/licenses/python-sphinx-latex/LICENSE", + "python-sphinx-latex", 1); + check_
Re: [PATCH RFC] scripts/sphinx-pre-install: add a script to check Sphinx install
Em Fri, 14 Jul 2017 19:35:59 +0200 Markus Heiser escreveu: > > Am 14.07.2017 um 18:49 schrieb Mauro Carvalho Chehab > > : > > > > Solving Sphinx dependencies can be painful. Add a script to > > check if everything is ok. > > just my 5cent: > > What we need is a "requirements.txt" file to define a > **reference environment**. E.g. to stick Sphinx 1.4.9 in > such a reference environment:: > > --- > Sphinx==1.4.9 > sphinx_rtd_theme > - > > The rest is similarly to what you wrote in doc-guide/sphinx.rst ... > > The ref-environment can be build with virtualenv & pip:: > > $ virtualenv --python=python3 docenv > (doc-env) $ source ./docenv/bin/activate > (doc-env) $ pip install -r requirements.txt > > From now we can start our build as usual. If not already done, > first activate the environment:: > > $ . ./docenv/bin/activate > (doc-env) $ make htmldocs > > This (requirements.txt) is the way python packaging goes. The above assumes that the user wants to use virtenv and have python3, virtualenv3 and pip3 already installed. I agree that a virtual environment works better than using distro-specific packaging, as Sphinx toolchain is really fragile. But we should give an option for the developer to use whatever he wants. I'm actually thinking that the final version of this script is to have a command line parameter to would allow selecting between virtenv or package install for Sphinx. IMHO, virtenv should be the default. > Ok, this won't solve TeX installation problems of Linux distros, > for this a script like the one here in your RFC is helpful. Your proposal doesn't solve Python, TeX, GraphViz nor ImageMagick dependencies. The TeX dependencies are the hardest ones, and, whatever solution we take, this should be taken into account. Thanks, Mauro -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html