Determining hit or miss direct mapped caches assembly

How would I tell if there is a hit or miss on a direct mapped caches from x86-64 assembly code?

So, if it is write-through and store-allocate and the instructions are:

movq    $  0x12CF,    (0x0) movq    (0x0),  %r9 movq    $  0x36FF,    (0x80) movq    (0x0),  %r10 

Also, it is assuming that initially all lines in the cache are invalid.

At the moment, I think that only lines 2 and 4 are hits since 0x0 because there is valid information there from line 1. Am I correct?


Browser caches the rewrited url. How to stop it from being cached?

I’m using nginx to rewrite a url

location /ReeferUI/Reports/ {        rewrite ^ /ReeferUI/index.html break;        proxy_pass  http://localhost:8083/ReeferUI;        proxy_set_header Host $  host;       } 

It is working fine but it is caching the index.html which I don’t want.

How can I prevent browser from caching redirection url?

Specific contacts syncing only caches with iOS from MacOS, in Itunes? Where are they?

I use MacOS 10.13.6 (on MBP15″ 2014) to sync to my iPhone 7 (lots of room available) running iOS 12.2 (current).

The phone will no longer update contacts except through iCloud, which I do not use for contacts.

The problem is this. I wipe out all the contacts on the phone, computer, iCloud, etc. Wipe out some files in library (everything with addressbook/contacts), some iTunes caches, the last backup of my device… BUT when I go to Sync contacts with iTunes:

1) the groups it shows ARE NOT the groups currently available in contacts! Contacts might even be empty, or could have updates ready. 2) Even if I say “replace all info for next sync only” it… RESTORES from some random snapshot of contacts that apparently exist >somewhere<…? What the frack!?

Now, I have gotten it to sync only the “me” card or not… but then the next sync it didn’t take any of the contacts after restored the db on macos…

Temporarily I’m using iCloud, but I’m not going to maintain it, so it’s only getting the most recent updates… and none of the groups…

I’ve gone under “Card… Look for duplicates”… I manually removed some weirdness in the contacts DB too, and things started looking better, but still no luck…

It will only restore from some weird version of the contacts database… So, my question, after trying tons of protocols (on various fora that all sounded promising) for wiping this stuff out, including iCloud related stuff… all of which seems to have some effect… just not the desired effect… I just want to know:

where is this cached or snapshot-version of contacts AND groups that is completely bulletproof! and that iTunes/ios/mac/macos/iphone/hand-of-deity has decided is the only set of groups and contact cards the phone will get?! (Outside of only using icloud). Can I delete them to fix this?

Compiler instructions to sync core caches: are they really needed?

I have read reviews of this book, and quote the following from one of the reviews (emphasis mine):

Other than straining your eyes with old-styled C++, you can read such misconceptions in the book like “Since Boolean values are generally atomic, setting and checking can be done simultaneously without risk or requiring a mutex.” Which ignores the facts that, the compiler doesn’t necessarily have to generate instructions to resync the value in register with the one in memory. And even if it does, the hardware doesn’t have to resync the cache lines.

I have also followed all of the “High Performance Computer Architecture” course from Georgia Tech (also on YouTube) and learned about cache coherency protocols.

From what I have learned, modern processors will use the write-invalidate protocol; when one core writes to a block, any other cores that share this same block will learn of the change via an invalidation message sent on the bus so they will have to go and get the new value from memory instead of using their cached copy.

With this in mind, what is the author of this comment talking about? It seems the coherency protocol is doing everything for me, hence there is no need to use synchronisation? Are they wrong or am I missing something?

PS Yes I know I mention C++ but I feel this is more hardware related hence me asking it here.

PPS If I’ve missed something, please post a link to the information before just downvoting; a downvote without explanation is useless.

Where does the responsibility for clearing higher-level caches lie in a pyrimidal calculation system with caching at multiple levels?

I’m working on system that analyses non-trivial amounts of data. The analysis is pyramidal, in that various combine to make intermediate values, which in turn combine with each other and more inputs to make higher-order intermediate values, and so on, until the value is produced. As a simple example: inputs A & B combine to make intermediate product X, inputs A & C combine to make intermediate product Y, inputs C & D combine to make intermediate product Z, and then intermediate products X, Y, and Z are combined with input E to make the final result. See below for a crude diagram representing this example relationship.

crude paint Paint diagram of pyramidal calculation

Nearly all of these steps are expensive enough to have user-noticeable performance costs, both retrieving the inputs and calculating the intermediate products. On the plus side, all of the inputs change only when requested by the user, so their values can be cached and reused, and the system can be specifically notified when one of the inputs has changed. Thus worrying about when to invalidate caches isn’t a problem.

The problem I’m struggling with is where the responsibility lies for clearing the caches for the intermediate products; after all, if input A changes in the example above, we need to recalculate X and Y, but we can keep the cached values of Z, as well as B, C, D, and E.

I’m using the Event Aggregator pattern, but I can’t decide what event the cache for, say, Y should use to trigger its invalidation. I can see a couple options:

  1. The cache for Y can subscribe to both the A-data-changed and the C-data-changed events and invalidate when it receives either of them. This requires Y to know that it depends on A & C, and means that higher-level caches have to subscribe to more and more data-changed events to cover all their dependencies (and their dependencies’ dependencies, and so on).
  2. The caches for A & C could send a Y-data-changed event whenever they receive their own data-change events. This would require them to know that Y depends on them, and would also require them to send data-changed events for all the downstream products that depend on them. Additionally, it would generate unnecessary duplicate change events for higher-level products (as multiple dependencies all try to pass on the message).
  3. A separate dependency manager / event translator could keep track of all the dependencies and know that, e.g. if it sees a C-data-changed event it needs to send Y-data-changed and Z-data-changed events, as well as events for anything that depends on Y or Z, all the way up the pyramid.

I’m leaning towards going with #3 and putting the new manager with/near the DI root. Are there advantages/disadvantages to these approaches I’ve overlooked? Or alternate approaches, at that?

Caches Credentials

Is anyone aware if PamCcreds works on Ubuntu 18 ? I am asking as the main way we authenticate on our Ubuntu 18 machines is sssd however for laptops I need to find a way of caching the credentials. Can anyone tell me if this is still working on Ubuntu 18 , and even more so does it work with sssd rather than ldap ? If not is there any other ways of doing this ?

How to clear all caches with Drush 9? this doesn’t give any option to clear all caches. All you get is to choose from 0-7, old drush cc all or cr all are gone.


root@dev:/var/www/ drush cc --cache-clear   Choose a cache to clear:   [0] Cancel   [1] drush   [2] theme-registry   [3] router   [4] css-js   [5] render   [6] plugin   [7] bin   [8] views  > 7   [success] 'bin' cache was cleared. 

How to clear all options below with one command? I can’t find it documented.

Does the web version of skype save chat history or caches any images received in a chat?

I’m logging into the Web version fo Skype with a Microsoft account.

I’m wondering if the web version of Skype does any of the following on your computer:

  • caches images;
  • saves chat history;

Any ideas?

I know that the Desktop version does this, so I was wondering if it’s still valid for the Web version.