public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug runtime/13546] New: improve map hashing
@ 2011-12-31  1:37 fche at redhat dot com
  2012-01-05 16:46 ` [Bug runtime/13546] " cmeek at redhat dot com
  0 siblings, 1 reply; 2+ messages in thread
From: fche at redhat dot com @ 2011-12-31  1:37 UTC (permalink / raw)
  To: systemtap

http://sourceware.org/bugzilla/show_bug.cgi?id=13546

             Bug #: 13546
           Summary: improve map hashing
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: runtime
        AssignedTo: systemtap@sourceware.org
        ReportedBy: fche@redhat.com
    Classification: Unclassified


The runtime/map* functions have several weaknesses w.r.t. hashing
that we should improve.

1) HASH_TABLE_BITS/SIZE should probably be a function of MAXMAPENTRIES.
2) str_hash() should be more hashy.  It looks rather wimpy.
3) With deliberate hash-collision-inducing data conceivably fed to stap,
   we should investigate salting the map FOO_hash functions with some
   runtime-random value, such as a few bytes collected at startup time with
   get_random_bytes(), as in

static unsigned long stap_hash_seed; /* init during module startup */
static unsigned int int64_hash (const int64_t v)
{
        return (unsigned int)hash_long (((unsigned long)v) ^ stap_hash_seed,
                                        HASH_TABLE_BITS);
}
/* and similarly for str_hash */

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug runtime/13546] improve map hashing
  2011-12-31  1:37 [Bug runtime/13546] New: improve map hashing fche at redhat dot com
@ 2012-01-05 16:46 ` cmeek at redhat dot com
  0 siblings, 0 replies; 2+ messages in thread
From: cmeek at redhat dot com @ 2012-01-05 16:46 UTC (permalink / raw)
  To: systemtap

http://sourceware.org/bugzilla/show_bug.cgi?id=13546

Chris Meek <cmeek at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |cmeek at redhat dot com
         AssignedTo|systemtap at sourceware dot |cmeek at redhat dot com
                   |org                         |

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-01-05 16:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-31  1:37 [Bug runtime/13546] New: improve map hashing fche at redhat dot com
2012-01-05 16:46 ` [Bug runtime/13546] " cmeek at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).