From: Paulo F. S. <pfs...@li...> - 2015-01-08 18:58:15
|
This patch add a --with-systemd attribute to install a systemd unit to turn smt on or off (permanently or not). After it's installed you can use systemd commands like: status, start, stop, enable and disable to control it. --- .gitignore | 1 + Makefile.am | 11 +++++++++++ configure.ac | 18 +++++++++++++++++- systemd/smt_off.service.in | 12 ++++++++++++ 4 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 systemd/smt_off.service.in diff --git a/.gitignore b/.gitignore index c0348c7..15d072b 100644 --- a/.gitignore +++ b/.gitignore @@ -47,6 +47,7 @@ /src/Makefile.in /src/drmgr/Makefile /src/drmgr/Makefile.in +/systemd/smt_off.service # # git files that we don't want to ignore even it they are dot-files diff --git a/Makefile.am b/Makefile.am index c302a54..3735a11 100644 --- a/Makefile.am +++ b/Makefile.am @@ -49,6 +49,10 @@ EXTRA_DIST += COPYRIGHT Changelog powerpc-utils.spec.in doc/activate_firmware.do doc/nvram.doxycfg doc/rtas_ibm_get_vpd.doxycfg doc/serv_config.doxycfg \ doc/set_poweron_time.doxycfg doc/uesensor.doxycfg +if WITH_SYSTEMD +EXTRA_DIST += systemd/smt_off.service.in +endif + sbin_PROGRAMS += src/nvram src/lsprop src/lparstat src/ppc64_cpu pseries_platform_SOURCES = src/common/pseries_platform.c src/common/pseries_platform.h @@ -145,3 +149,10 @@ src_drmgr_lsslot_SOURCES = \ $(pseries_platform_SOURCES) src_drmgr_lsslot_LDADD = -lrtas + +if WITH_SYSTEMD +install-data-hook: systemd/smt_off.service + $(MKDIR_P) @prefix@${systemd_unit_dir} + $(INSTALL_SCRIPT) $< @prefix@${systemd_unit_dir}/ + sed -i -e 's,$${exec_prefix},@sbindir@,g' @prefix@${systemd_unit_dir}/smt_off.service +endif diff --git a/configure.ac b/configure.ac index f7fcd55..7fa5b01 100644 --- a/configure.ac +++ b/configure.ac @@ -58,6 +58,22 @@ AS_IF([test "x$with_librtas" != "xno"], AM_CONDITIONAL([WITH_LIBRTAS], [test "x$with_librtas" = "xyes"]) +# check for systemd +systemd_unit_dir=/usr/lib/systemd/system +AC_ARG_WITH([systemd], + [AC_HELP_STRING([--with-systemd@<:@=DIR@:>@], + [install systemd unit files (not default and unit dir is /usr/lib/systemd/system)])], + [if test "$withval" = "no"; then + with_systemd=0 + else + with_systemd=1 + test $withval != "yes" && systemd_unit_dir=$withval + fi], + with_systemd=0 + ) +AM_CONDITIONAL(WITH_SYSTEMD, [test "$with_systemd" = 1]) +AC_SUBST(systemd_unit_dir) + AC_DEFUN([LOCAL_CHECK_FLAGS],[ AC_REQUIRE([AX_CHECK_LINK_FLAG]) AC_REQUIRE([AX_APPEND_COMPILE_FLAGS]) @@ -72,5 +88,5 @@ AC_DEFUN([LOCAL_CHECK_FLAGS],[ ]) LOCAL_CHECK_FLAGS -AC_CONFIG_FILES([Makefile powerpc-utils.spec]) +AC_CONFIG_FILES([Makefile powerpc-utils.spec systemd/smt_off.service]) AC_OUTPUT diff --git a/systemd/smt_off.service.in b/systemd/smt_off.service.in new file mode 100644 index 0000000..ed95945 --- /dev/null +++ b/systemd/smt_off.service.in @@ -0,0 +1,12 @@ +[Unit] +Description=ppc64 set SMT off +Before=libvirt-bin.service + +[Service] +Type=oneshot +RemainAfterExit=true +ExecStart=@sbindir@/ppc64_cpu --smt=off +ExecStop=@sbindir@/ppc64_cpu --smt=on + +[Install] +WantedBy=multi-user.target -- 2.1.0 -- Paulo Flabiano Smorigo IBM Linux Technology Center |
From: Breno L. <br...@br...> - 2015-01-19 16:27:29
|
Any interested in this patch? It helps a lot hypervisor installations, as using Ubuntu as a hypervisor. On 01/08/2015 04:27 PM, Paulo Flabiano Smorigo wrote: > This patch add a --with-systemd attribute to install a systemd unit > to turn smt on or off (permanently or not). > > After it's installed you can use systemd commands like: status, start, > stop, enable and disable to control it. > --- > .gitignore | 1 + > Makefile.am | 11 +++++++++++ > configure.ac | 18 +++++++++++++++++- > systemd/smt_off.service.in | 12 ++++++++++++ > 4 files changed, 41 insertions(+), 1 deletion(-) > create mode 100644 systemd/smt_off.service.in > > diff --git a/.gitignore b/.gitignore > index c0348c7..15d072b 100644 > --- a/.gitignore > +++ b/.gitignore > @@ -47,6 +47,7 @@ > /src/Makefile.in > /src/drmgr/Makefile > /src/drmgr/Makefile.in > +/systemd/smt_off.service > > # > # git files that we don't want to ignore even it they are dot-files > diff --git a/Makefile.am b/Makefile.am > index c302a54..3735a11 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -49,6 +49,10 @@ EXTRA_DIST += COPYRIGHT Changelog powerpc-utils.spec.in doc/activate_firmware.do > doc/nvram.doxycfg doc/rtas_ibm_get_vpd.doxycfg doc/serv_config.doxycfg \ > doc/set_poweron_time.doxycfg doc/uesensor.doxycfg > > +if WITH_SYSTEMD > +EXTRA_DIST += systemd/smt_off.service.in > +endif > + > sbin_PROGRAMS += src/nvram src/lsprop src/lparstat src/ppc64_cpu > > pseries_platform_SOURCES = src/common/pseries_platform.c src/common/pseries_platform.h > @@ -145,3 +149,10 @@ src_drmgr_lsslot_SOURCES = \ > $(pseries_platform_SOURCES) > > src_drmgr_lsslot_LDADD = -lrtas > + > +if WITH_SYSTEMD > +install-data-hook: systemd/smt_off.service > + $(MKDIR_P) @prefix@${systemd_unit_dir} > + $(INSTALL_SCRIPT) $< @prefix@${systemd_unit_dir}/ > + sed -i -e 's,$${exec_prefix},@sbindir@,g' @prefix@${systemd_unit_dir}/smt_off.service > +endif > diff --git a/configure.ac b/configure.ac > index f7fcd55..7fa5b01 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -58,6 +58,22 @@ AS_IF([test "x$with_librtas" != "xno"], > > AM_CONDITIONAL([WITH_LIBRTAS], [test "x$with_librtas" = "xyes"]) > > +# check for systemd > +systemd_unit_dir=/usr/lib/systemd/system > +AC_ARG_WITH([systemd], > + [AC_HELP_STRING([--with-systemd@<:@=DIR@:>@], > + [install systemd unit files (not default and unit dir is /usr/lib/systemd/system)])], > + [if test "$withval" = "no"; then > + with_systemd=0 > + else > + with_systemd=1 > + test $withval != "yes" && systemd_unit_dir=$withval > + fi], > + with_systemd=0 > + ) > +AM_CONDITIONAL(WITH_SYSTEMD, [test "$with_systemd" = 1]) > +AC_SUBST(systemd_unit_dir) > + > AC_DEFUN([LOCAL_CHECK_FLAGS],[ > AC_REQUIRE([AX_CHECK_LINK_FLAG]) > AC_REQUIRE([AX_APPEND_COMPILE_FLAGS]) > @@ -72,5 +88,5 @@ AC_DEFUN([LOCAL_CHECK_FLAGS],[ > ]) > LOCAL_CHECK_FLAGS > > -AC_CONFIG_FILES([Makefile powerpc-utils.spec]) > +AC_CONFIG_FILES([Makefile powerpc-utils.spec systemd/smt_off.service]) > AC_OUTPUT > diff --git a/systemd/smt_off.service.in b/systemd/smt_off.service.in > new file mode 100644 > index 0000000..ed95945 > --- /dev/null > +++ b/systemd/smt_off.service.in > @@ -0,0 +1,12 @@ > +[Unit] > +Description=ppc64 set SMT off > +Before=libvirt-bin.service > + > +[Service] > +Type=oneshot > +RemainAfterExit=true > +ExecStart=@sbindir@/ppc64_cpu --smt=off > +ExecStop=@sbindir@/ppc64_cpu --smt=on > + > +[Install] > +WantedBy=multi-user.target > |
From: Nathan F. <nf...@li...> - 2015-01-19 17:12:20
|
On 01/19/2015 09:57 AM, Breno Leitao wrote: > Any interested in this patch? It helps a lot hypervisor installations, as using > Ubuntu as a hypervisor. I started looking over this patch a few days ago. I need to go back and look at it again. -Nathan > > > On 01/08/2015 04:27 PM, Paulo Flabiano Smorigo wrote: >> This patch add a --with-systemd attribute to install a systemd unit >> to turn smt on or off (permanently or not). >> >> After it's installed you can use systemd commands like: status, start, >> stop, enable and disable to control it. >> --- >> .gitignore | 1 + >> Makefile.am | 11 +++++++++++ >> configure.ac | 18 +++++++++++++++++- >> systemd/smt_off.service.in | 12 ++++++++++++ >> 4 files changed, 41 insertions(+), 1 deletion(-) >> create mode 100644 systemd/smt_off.service.in >> >> diff --git a/.gitignore b/.gitignore >> index c0348c7..15d072b 100644 >> --- a/.gitignore >> +++ b/.gitignore >> @@ -47,6 +47,7 @@ >> /src/Makefile.in >> /src/drmgr/Makefile >> /src/drmgr/Makefile.in >> +/systemd/smt_off.service >> >> # >> # git files that we don't want to ignore even it they are dot-files >> diff --git a/Makefile.am b/Makefile.am >> index c302a54..3735a11 100644 >> --- a/Makefile.am >> +++ b/Makefile.am >> @@ -49,6 +49,10 @@ EXTRA_DIST += COPYRIGHT Changelog powerpc-utils.spec.in doc/activate_firmware.do >> doc/nvram.doxycfg doc/rtas_ibm_get_vpd.doxycfg doc/serv_config.doxycfg \ >> doc/set_poweron_time.doxycfg doc/uesensor.doxycfg >> >> +if WITH_SYSTEMD >> +EXTRA_DIST += systemd/smt_off.service.in >> +endif >> + >> sbin_PROGRAMS += src/nvram src/lsprop src/lparstat src/ppc64_cpu >> >> pseries_platform_SOURCES = src/common/pseries_platform.c src/common/pseries_platform.h >> @@ -145,3 +149,10 @@ src_drmgr_lsslot_SOURCES = \ >> $(pseries_platform_SOURCES) >> >> src_drmgr_lsslot_LDADD = -lrtas >> + >> +if WITH_SYSTEMD >> +install-data-hook: systemd/smt_off.service >> + $(MKDIR_P) @prefix@${systemd_unit_dir} >> + $(INSTALL_SCRIPT) $< @prefix@${systemd_unit_dir}/ >> + sed -i -e 's,$${exec_prefix},@sbindir@,g' @prefix@${systemd_unit_dir}/smt_off.service >> +endif >> diff --git a/configure.ac b/configure.ac >> index f7fcd55..7fa5b01 100644 >> --- a/configure.ac >> +++ b/configure.ac >> @@ -58,6 +58,22 @@ AS_IF([test "x$with_librtas" != "xno"], >> >> AM_CONDITIONAL([WITH_LIBRTAS], [test "x$with_librtas" = "xyes"]) >> >> +# check for systemd >> +systemd_unit_dir=/usr/lib/systemd/system >> +AC_ARG_WITH([systemd], >> + [AC_HELP_STRING([--with-systemd@<:@=DIR@:>@], >> + [install systemd unit files (not default and unit dir is /usr/lib/systemd/system)])], >> + [if test "$withval" = "no"; then >> + with_systemd=0 >> + else >> + with_systemd=1 >> + test $withval != "yes" && systemd_unit_dir=$withval >> + fi], >> + with_systemd=0 >> + ) >> +AM_CONDITIONAL(WITH_SYSTEMD, [test "$with_systemd" = 1]) >> +AC_SUBST(systemd_unit_dir) >> + >> AC_DEFUN([LOCAL_CHECK_FLAGS],[ >> AC_REQUIRE([AX_CHECK_LINK_FLAG]) >> AC_REQUIRE([AX_APPEND_COMPILE_FLAGS]) >> @@ -72,5 +88,5 @@ AC_DEFUN([LOCAL_CHECK_FLAGS],[ >> ]) >> LOCAL_CHECK_FLAGS >> >> -AC_CONFIG_FILES([Makefile powerpc-utils.spec]) >> +AC_CONFIG_FILES([Makefile powerpc-utils.spec systemd/smt_off.service]) >> AC_OUTPUT >> diff --git a/systemd/smt_off.service.in b/systemd/smt_off.service.in >> new file mode 100644 >> index 0000000..ed95945 >> --- /dev/null >> +++ b/systemd/smt_off.service.in >> @@ -0,0 +1,12 @@ >> +[Unit] >> +Description=ppc64 set SMT off >> +Before=libvirt-bin.service >> + >> +[Service] >> +Type=oneshot >> +RemainAfterExit=true >> +ExecStart=@sbindir@/ppc64_cpu --smt=off >> +ExecStop=@sbindir@/ppc64_cpu --smt=on >> + >> +[Install] >> +WantedBy=multi-user.target >> > > > ------------------------------------------------------------------------------ > New Year. New Location. New Benefits. New Data Center in Ashburn, VA. > GigeNET is offering a free month of service with a new server in Ashburn. > Choose from 2 high performing configs, both with 100TB of bandwidth. > Higher redundancy.Lower latency.Increased capacity.Completely compliant. > http://p.sf.net/sfu/gigenet > _______________________________________________ > Powerpc-utils-devel mailing list > Pow...@li... > https://lists.sourceforge.net/lists/listinfo/powerpc-utils-devel > |
From: Nathan F. <nf...@li...> - 2015-02-13 15:40:37
|
This has been pushed to the -next branch. -Nathan On 01/08/2015 12:27 PM, Paulo Flabiano Smorigo wrote: > This patch add a --with-systemd attribute to install a systemd unit > to turn smt on or off (permanently or not). > > After it's installed you can use systemd commands like: status, start, > stop, enable and disable to control it. > --- > .gitignore | 1 + > Makefile.am | 11 +++++++++++ > configure.ac | 18 +++++++++++++++++- > systemd/smt_off.service.in | 12 ++++++++++++ > 4 files changed, 41 insertions(+), 1 deletion(-) > create mode 100644 systemd/smt_off.service.in > > diff --git a/.gitignore b/.gitignore > index c0348c7..15d072b 100644 > --- a/.gitignore > +++ b/.gitignore > @@ -47,6 +47,7 @@ > /src/Makefile.in > /src/drmgr/Makefile > /src/drmgr/Makefile.in > +/systemd/smt_off.service > > # > # git files that we don't want to ignore even it they are dot-files > diff --git a/Makefile.am b/Makefile.am > index c302a54..3735a11 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -49,6 +49,10 @@ EXTRA_DIST += COPYRIGHT Changelog powerpc-utils.spec.in doc/activate_firmware.do > doc/nvram.doxycfg doc/rtas_ibm_get_vpd.doxycfg doc/serv_config.doxycfg \ > doc/set_poweron_time.doxycfg doc/uesensor.doxycfg > > +if WITH_SYSTEMD > +EXTRA_DIST += systemd/smt_off.service.in > +endif > + > sbin_PROGRAMS += src/nvram src/lsprop src/lparstat src/ppc64_cpu > > pseries_platform_SOURCES = src/common/pseries_platform.c src/common/pseries_platform.h > @@ -145,3 +149,10 @@ src_drmgr_lsslot_SOURCES = \ > $(pseries_platform_SOURCES) > > src_drmgr_lsslot_LDADD = -lrtas > + > +if WITH_SYSTEMD > +install-data-hook: systemd/smt_off.service > + $(MKDIR_P) @prefix@${systemd_unit_dir} > + $(INSTALL_SCRIPT) $< @prefix@${systemd_unit_dir}/ > + sed -i -e 's,$${exec_prefix},@sbindir@,g' @prefix@${systemd_unit_dir}/smt_off.service > +endif > diff --git a/configure.ac b/configure.ac > index f7fcd55..7fa5b01 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -58,6 +58,22 @@ AS_IF([test "x$with_librtas" != "xno"], > > AM_CONDITIONAL([WITH_LIBRTAS], [test "x$with_librtas" = "xyes"]) > > +# check for systemd > +systemd_unit_dir=/usr/lib/systemd/system > +AC_ARG_WITH([systemd], > + [AC_HELP_STRING([--with-systemd@<:@=DIR@:>@], > + [install systemd unit files (not default and unit dir is /usr/lib/systemd/system)])], > + [if test "$withval" = "no"; then > + with_systemd=0 > + else > + with_systemd=1 > + test $withval != "yes" && systemd_unit_dir=$withval > + fi], > + with_systemd=0 > + ) > +AM_CONDITIONAL(WITH_SYSTEMD, [test "$with_systemd" = 1]) > +AC_SUBST(systemd_unit_dir) > + > AC_DEFUN([LOCAL_CHECK_FLAGS],[ > AC_REQUIRE([AX_CHECK_LINK_FLAG]) > AC_REQUIRE([AX_APPEND_COMPILE_FLAGS]) > @@ -72,5 +88,5 @@ AC_DEFUN([LOCAL_CHECK_FLAGS],[ > ]) > LOCAL_CHECK_FLAGS > > -AC_CONFIG_FILES([Makefile powerpc-utils.spec]) > +AC_CONFIG_FILES([Makefile powerpc-utils.spec systemd/smt_off.service]) > AC_OUTPUT > diff --git a/systemd/smt_off.service.in b/systemd/smt_off.service.in > new file mode 100644 > index 0000000..ed95945 > --- /dev/null > +++ b/systemd/smt_off.service.in > @@ -0,0 +1,12 @@ > +[Unit] > +Description=ppc64 set SMT off > +Before=libvirt-bin.service > + > +[Service] > +Type=oneshot > +RemainAfterExit=true > +ExecStart=@sbindir@/ppc64_cpu --smt=off > +ExecStop=@sbindir@/ppc64_cpu --smt=on > + > +[Install] > +WantedBy=multi-user.target > |