Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1322905

Re: [PATCH 1/4] sched,time: remove non-power-of-two divides from __acct_update_integrals

From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject Re: [PATCH 1/4] sched,time: remove non-power-of-two divides from __acct_update_integrals
Date 2016-02-01 09:40 +0100
Message-ID <qXibE-8pb-7@gated-at.bofh.it> (permalink)
References <qXcfT-45K-3@gated-at.bofh.it> <qXcfU-45K-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun, 31 Jan 2016, riel@redhat.com wrote:
> @@ -93,9 +93,9 @@ void xacct_add_tsk(struct taskstats *stats, struct task_struct *p)
>  {
>  	struct mm_struct *mm;
>  
> -	/* convert pages-usec to Mbyte-usec */
> -	stats->coremem = p->acct_rss_mem1 * PAGE_SIZE / MB;
> -	stats->virtmem = p->acct_vm_mem1 * PAGE_SIZE / MB;
> +	/* convert pages-nsec/1024 to Mbyte-usec, see __acct_update_integrals */
> +	stats->coremem = p->acct_rss_mem1 * PAGE_SIZE / (1000 * KB);
> +	stats->virtmem = p->acct_vm_mem1 * PAGE_SIZE / (1000 * KB);

You replace "/ (1024 * 1024)" by "/ (1000 * 1024). So that's introducing a non
power of 2 division instead of removing one and wont compile on systems which
do not have a 64/32 division in hardware.

Thanks,

	tglx

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/4] sched,time: remove non-power-of-two divides from __acct_update_integrals riel@redhat.com - 2016-02-01 03:20 +0100
  Re: [PATCH 1/4] sched,time: remove non-power-of-two divides from  __acct_update_integrals kbuild test robot <lkp@intel.com> - 2016-02-01 05:50 +0100
  Re: [PATCH 1/4] sched,time: remove non-power-of-two divides from  __acct_update_integrals Thomas Gleixner <tglx@linutronix.de> - 2016-02-01 09:40 +0100
    Re: [PATCH 1/4] sched,time: remove non-power-of-two divides from  __acct_update_integrals Peter Zijlstra <peterz@infradead.org> - 2016-02-01 10:30 +0100
      Re: [PATCH 1/4] sched,time: remove non-power-of-two divides from  __acct_update_integrals Thomas Gleixner <tglx@linutronix.de> - 2016-02-01 10:40 +0100
      Re: [PATCH 1/4] sched,time: remove non-power-of-two divides from  __acct_update_integrals Rik van Riel <riel@redhat.com> - 2016-02-01 14:50 +0100
        Re: [PATCH 1/4] sched,time: remove non-power-of-two divides from  __acct_update_integrals Peter Zijlstra <peterz@infradead.org> - 2016-02-01 15:00 +0100

csiph-web